iUnknown
22-10-2008, 09:05 PM
Hello,
I need a little help splitting up/exploding a variable in PHP.
Say this is my variable:
2;C;/Diamond/0/DiamondM2/thedeath-v2.321//;C;/Diamond/16/DiamondM2/thedeath-v2.321//;
I can do:
$u = split(";",$mylongvariable);
$u = split("/",$u[4]);
$user = $u[2];
And $user will = 16, the part of the string that I'm after.
However for this variable:
2;Sting/99/0/GOOD;Sting/0/6/GOOD;
I need to get the 6 (nearish the end). How would I do that?
Thanks and +rep to correct answer.
I need a little help splitting up/exploding a variable in PHP.
Say this is my variable:
2;C;/Diamond/0/DiamondM2/thedeath-v2.321//;C;/Diamond/16/DiamondM2/thedeath-v2.321//;
I can do:
$u = split(";",$mylongvariable);
$u = split("/",$u[4]);
$user = $u[2];
And $user will = 16, the part of the string that I'm after.
However for this variable:
2;Sting/99/0/GOOD;Sting/0/6/GOOD;
I need to get the 6 (nearish the end). How would I do that?
Thanks and +rep to correct answer.