title: subsitute word from regex to another word
body: <p>I have the following code with me, it produce the img title of specified text,</p>
  
  <p>let say the title = waterfallfountainpicture20x20, how do i replace the word fountain with lagoon so it would become waterfalllagoonpicture20x20?</p>
  
  <pre><code>preg_match_all('/&lt;img[^&gt;]+&gt;/i',$html, $result);
  $img = array();
  foreach( $result[0] as $img_tag)
  {
      preg_match_all('/(title)="([^"]*)"/i',$img_tag, $img[$img_tag]);
  }
  
  //print_r($img);
  foreach ($img as $imgg)
   echo $imgg[2][0];
  </code></pre>
  
  <p>Thank you very much for your help </p>