Hi there, i need replace this page: test one.html with test_one.html I try this code $url = str_replace(" ","_",$datas[category]); But don't work... This is my url string: <a href='$url/$datas[category].html'>$cats</a>"; PHP: Someone can help me please? Thanks in advance
This might not working because you are setting $url as the variable to store the replacement into but you need to save it to the original source in the $datas array Try this $url = 'http://www.yoursite.com'; $datas['category'] = str_replace(" ","_",$datas['category']); echo "<a href='".$url."/".$datas['category'].".html'>".$cats."</a>"; PHP: Hope this helps