HomebrewGr

How to change the size of video with php

If you use php on your site and share video from Youtube or vimeo, see how you can change their size easily, without changing every single post.

Let's say you have a post and it contains an embed code from Youtube. You will going to pass the post's content into a variable named $post.

Using the preg_replace function we'll change the size of the video.

This way will always keep the videos in one size, which is ideal if you have a lot of posts and you don't want to change them manually.

$post= preg_replace('/(width)=("[^"]")/i', 'width="600"', $post);
$post= preg_replace('/(height)=("[^"]
")/i', 'height="400"', $post);

Full Post

Related topics:

Boot homebrew software on your Nintendo Wii without modchip

Need a valid Windows XP key? Use Belarc Advisor!

Performance boost for X800 GT cards with R480 GPU

Play CS 1.6 no-steam Online

How to Stop Getting Stuck on the Loading Screen in Obduction