james Oduro james Oduro - 2 months ago 8
PHP Question

Split string into variables

I have the following string:

157458210148


The first 10 character represents something to me so I split it using the
substr()
function like this:

$pin= "157458210148";
$order_num = substr($pin,0,10);


My question is, how do I return the rest of the string and assign it to a variable?

Example
$id = 48

Answer

Here's an alternative to get both at one time:

list($order_num, $other_num)  = str_split($pin, 10);