Advertisement
Guest User

Search_replace

a guest
Jan 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. //https://stackoverflow.com/questions/8163746/how-to-replace-certain-parts-of-my-string
  2. $find       = ['a','b','c','z','y','x'];
  3.         $replace    = ['z','y','x','a','b','c'];
  4.  
  5.         echo str_replace($find,$replace,'abczyx');
  6.         //Expected output: zyxabc
  7.         //Actual output:   abcabc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement