title: php preg_replace swap out height and width of iframe
body: <p>I am trying to replace the height and width on an html iframe src upon being saved to a database. I have looked at the preg_replace function and PCRE expressions but can't work it out. Listed below is my code and sample input </p>
  
  <pre><code>$pattern1 = '/width="[0-9]*"/';
  $pattern2 = '/height="[0-9]*"/';
  $subject  = '&lt;iframe src="http://player.vimeo.com/?title=0&amp;amp;byline=0&amp;amp;portrait=0" width="400" height="300" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;';
  
  $returnValue = $preg_replace(array($pattern1, $pattern2), array('width="200"','height="200"'), $subject);
  </code></pre>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Cheers folks! </p>