[eluser]John_Betong[/eluser]
[quote author="basty_dread" date="1260455112"]Hello guys i need help on the preg_replace()
I want to remove the spaces on this string:
Code:
$keyword = "Law Firm Action";
and replace it with "/" so the output will be
Law/Firm/Action
I tried this code but i had an error:
Code:
$keyword = "Law Firm Action";
$search = ' ';
$replace='/';
$replacedkeyword = preg_replace($search, $replace, $key_word);
Why not use str_replace(...)
Code:
$keyword = "Law Firm Action";
$s = str_replace(' ', '/', $keyword);
Please Help me thank you.[/quote]