17 Replies Latest reply: May 26, 2012 3:04 PM by bregent RSS

    finding number in a string

    future-architect Community Member

      I am trying to find a number in a string from my database to replace it.  Here is my funciton:

       

      function findUserID($friendsString, $userToFind){

                echo $friendsString . " " . $userToFind;

                $pos = strpos($friendsString,$userToFind);

                if($pos){

                          return true;

                }

                return false;

      }

       

      it returns "25,29 25".  How can it not find 25 in that string?