PHP Form
Free PHP forms, scripts, resources and tutorials.


str_replace

Published: 08/09/10


PHP str_replace

This function returns a string or an array with all occurrences of search in subject replaced with the given replace value.

Code index.php:
<?php
$content 
'PHP 1 2 3';
$str = array('1','2','3');
$replace = array('is an open-source','server-side','scripting language');
$output str_replace ($str,$replace,$content);
echo 
$output;
?>

Comments


Add a Comment

Name:


Comment:




Sitemap