I'm looking to parse some php code...
I have the string "111,222?333,444"
I'm trying to get two variables $var1 = 333 and $var2 = 444
the number characters are not necessarily in groups of three (there maybe one or more numbers). I'm trying to get the numbers to the right of the question mark but before the comma into one variable, and the remaining numbers after the second comma into another variable.
thanks for your help
PHP reg expr question
Moderator: General Moderators
Re: PHP reg expr question
Code: Select all
$string = "111,222?333,444";
strtok($string, "?"); // ignore the first part
$before = strtok(","); // the stuff before the first comma
$after = strtok(""); // the rest of the string