SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some regex help please

    Hello I'm using this regex for a submit form on my website that ensures that the link they enter starts with "http://", if it doesn't it sends them to an error page.

    if(preg_match('/.*http:\//', $linkres->title)) {

    I don't actually quite understand how that regex statement works, but I'de like to modify it so that it also requires ".mp3" to be at the end of the link as well. If anyone can help me with this that would be great. Thanks in advance!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    if (preg_match('/https?:\/\/.*\.mp3$/'$linkres->title)) { 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •