Okay. Say I have string
'193'
And I want to remove the last numbers and store them in an array so I can do operations with them. I know substr can delete the 2 characters, but I'm not sure how to store them after they've been removed..
$end[] = substr("193", -2);
Will store "93" in the array $end
Why not treat it as a number (your question said it's a numeric string) ?
$last2 = $str%100;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With