find position of a value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

find position of a value

Post 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
Farrier
Forum Newbie
Posts: 12
Joined: Thu Mar 25, 2004 10:39 am

Post 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 :)
Post Reply