-1

How to validate this url us audio url

<input type="url" id="audio" name="audio" value="http://localhost/audio/warna.mp3">

anyone one can enter http://fake.com/audio.mp3 OR http://real.com/fake.mp3 OR http://real.com html5 input type only check url but not audio url

this is link only confirm that url exist or not but don't validate that this url is audio url How can I check if a URL exists via PHP?
Please anyone guide me to solve it.

Community
  • 1
  • 1
Ahmad Sayeed
  • 344
  • 2
  • 14
  • 4
    Possible duplicate of [How can I check if a URL exists via PHP?](http://stackoverflow.com/questions/2280394/how-can-i-check-if-a-url-exists-via-php) – Dmytro Pastovenskyi Oct 17 '15 at 14:46

1 Answers1

0

refer to How can I check if a URL exists via PHP? at first you should check the file extension against audio file formats the next step is to use the example above to check is the url exists.

Community
  • 1
  • 1