Hyvor Developer
  Home   Download   Copy
Code
<?php
$str = 'Hello World';

// outputs "Hello World"
echo preg_replace('/hello/', 'Hi', $str); 

echo '<br>';

// outputs "Hi World"
echo preg_replace('/hello/i', 'Hi', $str);
Result