Friday, December 1, 2017

String Replace in PHP


<?php

$string = 'I am thet naing win';

$find = array('thet', 'naing', 'win');
$replace = array('THET', 'NAING', 'WIN');

$string_new = str_replace($find, $replace, $string);
echo $string_new;

?>

No comments:

Post a Comment