Page 1 of 1

find position of a value

Posted: Thu Mar 25, 2004 3:19 am
by pelegk2
i know there is a function (which its name i cant remember
(maybe its in mysql or php)
that say if i have a field with
1,4,22,7,2

and i asked t check if there is a 2 value it returns me true
does any 1 knows what i talk about?
thanks in advane
peleg

Posted: Thu Mar 25, 2004 10:39 am
by Farrier
Could be strstr() if you want to find a token within a string:
http://www.php.net/manual/en/function.strstr.php

Or you can use array_search() if you want to find a value in an array.
http://www.php.net/manual/en/function.array-search.php

Hope that helps :)