Re: [PHP] How to take video embed codes and change all their widths/heights?

2008-01-16 Thread Richard Lynch
$stringtoedit = preg_replace("/width=(\"?[0-9%]\"?[^0-9%\"])/msi", "width=\"\\1\"", $stringtoedit); $stringtoedit = preg_replace("/height=(\"?[0-9%]\"?[^0-9%\"])/msi", "height=\"\\1\"", $stringtoedit); This "adds" quotes around quote-less values, which were once acceptable HTML, but aren't really

Re: [PHP] How to take video embed codes and change all their widths/heights?

2008-01-16 Thread Daniel Brown
On Jan 15, 2008 6:37 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Daniel Brown schreef: > > .. > > > > > $embed_code = > > preg_replace('/height="([0-9]*)"/U','height="'.$height.'"',preg_replace('/width="([0-9]*)"/U','width="'.$width.'"',$embed_code)); > > I wouldn't have given him the complete re

Re: [PHP] How to take video embed codes and change all their widths/heights?

2008-01-15 Thread Jochem Maas
Daniel Brown schreef: .. $embed_code = preg_replace('/height="([0-9]*)"/U','height="'.$height.'"',preg_replace('/width="([0-9]*)"/U','width="'.$width.'"',$embed_code)); I wouldn't have given him the complete regexp - how will they ever learn. :-) BUT $embed_code = preg_replace( arr

Re: [PHP] How to take video embed codes and change all their widths/heights?

2008-01-15 Thread Daniel Brown
On Jan 15, 2008 5:25 PM, Rob Gould <[EMAIL PROTECTED]> wrote: > Can anytime give me some insights on how to write a PHP script that > could accept any of the below strings below and edit the strings to > change their width and height settings dynamically? > > For instance, if I want all embedded vi