I have a number of ids that look like this:
100000584438452_522814274414716
1050090160_4191766746351
704475642_509010235785154
I need to split each up, and get the numbers after the _
I need to put the numbers after the _ in a variable $object_id.
Thanks
You can split the string around the underscore and then set $object_id as the last value, like so:
$chunks = explode("_", $number_id);
$object_id = end($chunks);
I´m sure that if you read this url http://php.net/manual/en/function.split.php you´ll get it. There are even examples that can help you out.
split() has been deprecated. try http://php.net/manual/en/function.explode.php
$arrayOfIds = explode("_", $yourIdsSeparatedByUnderscore);
$objectId = $arrayOfIds[1];