Pop the last x bytes of a string off the string and return it. Any classic way to do it in PHP other than a custom function like this?
function string_pop(&$str, $num) {
$pop = substr($str, - $num);
$str = substr($str, 0, strlen($str) - $num);
return $pop;
}