PHP Str_Replace() Accepts Arrays For All Its Arguments – String Function

<?php
$source = array("a","b" );
$search = array( "a", "2000" );
$replace = array ( "b", "2001" );
$source = str_replace( $search, $replace, $source );
foreach ( $source as $str )
  print "$str<br />";?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.