Forum Moderators: coopster
I have been toying with that for a while
What are your requirements?
is the URL looking like [www....] etc...?
then
1)check if well formed
2)check for bad words
3)does it exists (Is the DN for real)?
let us know
[edited by: coopster at 9:49 pm (utc) on Oct. 12, 2006]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]
However, if that does indeed happen with most videos, open the url with fopen / fsockopen, read the first x number of chars, make an array of all the different text strings that appear in the video types you're looking for and then search for those strings in the data you've read.
$handle = fopen('http://url...');
$data = fread($handle,4096); // reading 4096 chars
fclose($handle);
$video_text = array('Mpeg text string','Other mpeg string','wmv string'...);
foreach($video_text as $video_str)
{
if(strpos($data,$video_arr)!== false)
{
//is video
}
}
It'd also be worth checking out the Snoopy class, it makes open urls and getting the data very easy.