str_replace met arrays


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



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $var = "Dit is gewoon wat tekst";
  4. $var1 = str_replace(Array('i', 'e'), Array('e', 'i', $var); //i wordt vervangen door e en e door i
  5. $var2 = str_replace(Array('i', 'e'), 'o', $var); //i en e worden vervangen door o
  6.  
  7. ?>

URL: http://nl3.php.net/str_replace

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.