Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Posts
    31

    Looking for a PHP Function - Search String and

    Hello, I am looking for a PHP function hat can search a string, looking for a character. Once it has spot the character it displays everything prior to that character. Does anyone know of a function that can do this? I've looked on PHP.net but just couldn't find one.

  2. #2
    Join Date
    Jul 2003
    Location
    Goleta, CA
    Posts
    5,550
    you might be able to tweak something like http://us3.php.net/manual/en/function.strrchr.php to work.

  3. #3
    Join Date
    May 2004
    Location
    Baltimore, MD
    Posts
    1,203
    quick attempt:

    $var = substr($string, 0, strpos($string, 'c'));

    Not at home so I can't really test it, but I think that'll work.

    Good luck bud, hope I helped.
    Automated Tendencies - Brand Management Agency from Baltimore, Maryland.
    Reputation Management Search Engine Optimization Pay Per Click Email Marketing

  4. #4
    Join Date
    Oct 2006
    Posts
    31
    Thank you RefreshNet, really appericate it.

  5. #5
    Join Date
    May 2004
    Location
    Baltimore, MD
    Posts
    1,203
    Not a problem, I try to help when I can. Have a good night bud.
    Automated Tendencies - Brand Management Agency from Baltimore, Maryland.
    Reputation Management Search Engine Optimization Pay Per Click Email Marketing

Posting Permissions

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