Good. Say I have a line
'193'
And I want to delete the last numbers and store them in an array so that I can perform operations with them. I know substr can remove two characters, but I'm not sure how to save them after deleting them.
$end[] = substr("193", -2);
Will store "93" in the $ end array
Why not treat it like a number (your question said it was a number string)?
$last2 = $str%100;
$array = str_split('193'); // $array now has 3 elements: '1', '9', and '3' array_shift($array); // this removes '1' from $array and leaves '9' and '3'
$str = "193"; $str_array = str_split($str); $number_1 = array_pop($str_array); //3 $number_2 = array_pop($str_array); //9