ma3743
11-20-2007, 04:58 AM
I have a string like this:
$str = "2|345 1|50 2|1461 3|555 ";
pattern is level|id
And I want delete an level|id from this string
But my problem is that is just know ID but not level
$ID = "1461";
$lookfor = "X|" . $ID . " ";
$newstr = str_replace($lookfor, "", $str);
And I want get this:
$ newstr = "2|345 1|50 3|555 ";
How can I do that?
Tanks in advance
$str = "2|345 1|50 2|1461 3|555 ";
pattern is level|id
And I want delete an level|id from this string
But my problem is that is just know ID but not level
$ID = "1461";
$lookfor = "X|" . $ID . " ";
$newstr = str_replace($lookfor, "", $str);
And I want get this:
$ newstr = "2|345 1|50 3|555 ";
How can I do that?
Tanks in advance