Replace string in PHP


/ Published in: PHP
Save to your folder(s)

Search for a string, if matched replace with second provided paramater. Third parameter is the variable whose value is the string you'd like to search.


Copy this code and paste it in your HTML
  1. <?PHP
  2. $name = $_POST[name];
  3. $pagelink = str_replace(" ","_",$name);
  4. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.