PHP webdeveloper and frontend developer

How to resize youtube or vimeo movies with PHP

Category : PHP · by May 27th, 2009

You have to use the preg_replace php function here. The $video variable holds the embed code fromyoutube, vimeo or other similar website that use these parameters in their embed codes in the example. You can change the width and height in the second parameter. This will replace the width and height parameters in you embed code with you desired width. That way inserted video‘s by users won‘t mess up your layout.



Leave a Reply

Your email address will not be published. Required fields are marked *