Hey guys I am stuck in a tricky situation:
I have a list of mp3 url's.....However b4 trying to use them into my mp3player, I just want to make sure whether the url's are valid mp3 urls or not (by valid i mean, some might be dead too).
Here are the 4 cases:
[/I]I validate them using this code:
[/B]
Now the problem is that only 1st url in the list is a valid mp3.
2) and 3) are dead links for which, if u type them directly in the browser u will get timed out or do not exits.
Now the tricky one is the 4th one:
It ends with .mp3 extension, also returns a response to the code, but actually its an html page.
Just type the 4th url in the browser and you would know.
Now I want to filter these cases too. Can someone help me here ??
Points gauranteed to the first correct answer.
I have a list of mp3 url's.....However b4 trying to use them into my mp3player, I just want to make sure whether the url's are valid mp3 urls or not (by valid i mean, some might be dead too).
Here are the 4 cases:
Code:
[B] [I]1) // Resource #2 Ok -> $fixed_url = "http://www.adoptedaustralian.net/glorylibertymix/nanowrimo/05%20Damien%20Rice%20-%20Older%20Chests.mp3";[/I]
[I]2) // Blank Timed Out -> $fixed_url = "http://bellx1.davejeffery.com/Upload/data/Damien%20Rice-I%20rememer-Damien%5C%27s%20part%20only.mp3";[/I]
[I]3) // Blank Not found -> $fixed_url = "http://info.showroomseven.com/SHOWROOM_SEVEN/Amber/Eskimo.mp3";[/I]
[I]4) // Resource id#2 Ok but not mp3 ->$fixed_url = "http://www.flashbacked.net/mp3/04%20Wish%20You%20Were%20Here.mp3";
[/I]I validate them using this code:
[/B]
Code:
$fixed_url = "Choose one of the url from above";
[B] $urlresponse = @fopen($fixed_url, "r");
[U]echo[/U] $urlresponse;[/B]
Now the problem is that only 1st url in the list is a valid mp3.
2) and 3) are dead links for which, if u type them directly in the browser u will get timed out or do not exits.
Now the tricky one is the 4th one:
It ends with .mp3 extension, also returns a response to the code, but actually its an html page.
Just type the 4th url in the browser and you would know.
Now I want to filter these cases too. Can someone help me here ??
Points gauranteed to the first correct answer.