SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    ********* Shroom mydster's Avatar
    Join Date
    Nov 2002
    Location
    tpyge
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    regex and mime type help

    I am a bit of a noobie... however, I've been reading the sitepoint php book and came across some code:

    eregi('^image/p?jpeg(;.*)?$', $_FILES['uploaddedfile']['type']) )

    Now, this basically checks the type of an upload file named 'uploadedfile'

    My question is, what does this mean:

    (;.*)?$ and why is ^ at the beginning necessary?

    Thanks.

  2. #2
    SitePoint Zealot Ghandi's Avatar
    Join Date
    Sep 2002
    Location
    Kansas
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^ signifies the beginning. $ signifies the end.

    (;.*)? i do not know.

    for a decent tutorial.
    http://www.sitepoint.com/article/974/2
    W.W.G.D. :: What Would Gandhi Do
    http://patkohler.blogspot.com/


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
  •