Thread: ereg expression

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Mammoth Spring, Arkansas
    Posts
    3
    Rep Power
    0
    I have been trying for hours to figure out how get PHP to take a ' sign. why won't the below work?

    $term = ereg_replace("'","",$term);

    thanx
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    You don't need the before the '. You can have singal qoutes within double qoutes.

    -Jerome
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    16
    That's not what he's asking.

    $term = ereg_replace("'","",$term);
    should be:
    $term = ereg_replace("'","'",$term);

    (put the item to be replaced 1st)
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    It's late and my eyes weren't working right. Good Job Jon.

    -Jerome
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Mammoth Spring, Arkansas
    Posts
    3
    Rep Power
    0
    thnx so much for the help you two!
    p.s. he is she :-)

Similar Threads

  1. DBI warnings -- plz help
    By pranesh in forum Perl Programming
    Replies: 4
    Last Post: December 1st, 2003, 07:52 PM
  2. Need ereg regular expression help
    By KOSTASVAGIS in forum Software Design
    Replies: 2
    Last Post: September 18th, 2003, 07:07 PM
  3. ereg expression help please
    By JonnyThunder in forum PHP Development
    Replies: 3
    Last Post: July 21st, 2003, 05:50 AM
  4. ereg; matching * behind another ereg match
    By sankyu in forum PHP Development
    Replies: 5
    Last Post: April 7th, 2003, 04:52 PM
  5. Using ereg to exclude certain lines in a web log
    By gwaine in forum PHP Development
    Replies: 5
    Last Post: April 16th, 2002, 11:46 AM

IMN logo majestic logo threadwatch logo seochat tools logo