string - Php str_replace not working -
i've got long string space delimited (read in txt file)
input string:
$value = "testnumber1 x chan 1 wrap hi (5.0 v) (unc) 9.860 v gele (>= <=) 9.750 10.250 passed"
what want do, , have done succesfully explode string array using:
$exploded = explode(" ",$value);
unfortunatly though, want seperate between gele (>= <=) part, , following number (in case 9.750), thought make easy, before explode string i'll do:
$value = str_replace("gele (>= <=) ","gele (>= <=) ",$value);
the problem is, reason replace isn't working. it's if it's not seeing needle. exploded string array giving me after doing str_replace.
array ( [0] => testnumber1 x chan 1 wrap hi (5.0 v) (unc) [1] => 9.860 [2] => v [3] => gele (>= <=) 9.750 [4] => 10.250 [5] => passed [6] => )
as can see, element [3] => gele (>= <=) 9.750
is there stupid i'm doing here make str_replace function not work?
thanks in advance.
the whitespace after string may tab character rather spaces.
try first replacing tabs \t
spaces.
Comments
Post a Comment