egturnkey Posted March 14, 2010 Share Posted March 14, 2010 hello dear friends, If i have $manal = "thank you for help"; and $URL = "siteroot/index.php?r$id"; then i will create a URL but i will remove whitespace $manal = str_replace(' ', '-', trim($manal)); then i will make the link as follow $URL = "siteroot/$manal-$id.html"; but it needs .htaccess Okay then let say RewriteRule -(.*)\.html index.php?r=$1 NOW the problem it won't works and works only if i removed $manal = str_replace(' ', '-', trim($manal)); so is there any prblem with .htaccess and str_replace or am i did something wrong !! thanks Link to comment https://forums.phpfreaks.com/topic/195179-how-to-write-str_replace/ Share on other sites More sharing options...
wildteen88 Posted March 14, 2010 Share Posted March 14, 2010 Its most probably your rewrite rule that is the issue, RewriteRule -(.*)\.html index.php?r=$1 Change the above to RewriteRule ([0-9]+).html$ index.php?r=$1 Link to comment https://forums.phpfreaks.com/topic/195179-how-to-write-str_replace/#findComment-1025861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.