$myString="[COLOR="Blue"]1234[/COLOR][COLOR="red"]_[/COLOR]567[COLOR="red"]_[/COLOR][COLOR="green"]90[/COLOR]";
$left_of_delimiter = array_shift(explode('_', $myString));
The code above produces “1234” which is at the left of the delimeter “_”.
How can I produce the string "90"which is at the right of the delimeter “_”?
oddz
2
list($l,$m,$r) = explode('_',$mystring,3);
echo "<p>Right: $r</p>";
Thank you very much, oddz.
Cups
4
In the case you have 1 or more delimeters appearing
$myString = "1234_567_90";
$left_of_delimiter = array_shift(explode('_', $myString));
$right_of_last_delimeter = array_pop(explode('_', $myString));
echo $right_of_last_delimeter;
//90