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(
array('/height="([0-9]*)"/U', '/width="([0-9]*)"/U')
array('height="'.$height.'"', 'width="'.$width.'"'),
$embed_code);
i.e. save the nested calls to preg_replace()
when's the last time you read the manual man-with-really-long-name? :-P
echo $embed_code."\n";
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php