PHP Explode Function Help
Posted: Sun Jul 05, 2009 9:09 am
My Programmer used this code to strip out characters expect the youtube ID in order to create the thumbnail picture of youtube video.
For a youtube link like: src="http://www.youtube.com/v/XrL5YIsUQu0"
He used this code:
So that thumbnail image URL result will be http://img.youtube.com/vi/XrL5YIsUQu0/default.jpg
Now Youtube has additional strings with src=link. I am not able to explode the addition strings by using above method.
Now Youtube link look like this: src="http://www.youtube.com/v/XrL5YIsUQu0&hl=en&fs=1&rel=0"
How to strip out &hl=en&fs=1&rel=0 after the youtube video ID by using same above method?
Now youtube thumbnail image link comes like this:
http://img.youtube.com/vi/XrL5YIsUQu0&hl=en&fs=1&rel=0/default.jpg
I want it as http://img.youtube.com/vi/XrL5YIsUQu0/default.jpg
Your help will be appreciated.
For a youtube link like: src="http://www.youtube.com/v/XrL5YIsUQu0"
He used this code:
Code: Select all
$colony = explode("src=",$videoembed);
$colonized = explode("/",$colony[1]);
$colonizer = explode("\"",$colonized[4]);
$coloni = explode("&",$colonizer[4]);
$thumb_name = "http://img.youtube.com/vi/".$colonizer[0]."/default.jpg";Now Youtube has additional strings with src=link. I am not able to explode the addition strings by using above method.
Now Youtube link look like this: src="http://www.youtube.com/v/XrL5YIsUQu0&hl=en&fs=1&rel=0"
How to strip out &hl=en&fs=1&rel=0 after the youtube video ID by using same above method?
Now youtube thumbnail image link comes like this:
http://img.youtube.com/vi/XrL5YIsUQu0&hl=en&fs=1&rel=0/default.jpg
I want it as http://img.youtube.com/vi/XrL5YIsUQu0/default.jpg
Your help will be appreciated.