function to discover if value is already in array

From: Date: Fri, 21 Feb 2003 15:08:07 +0000
Subject: function to discover if value is already in array
Groups: php.general 
Request: Send a blank email to php-general+get-136514@lists.php.net to get a copy of this message
Here is an example array: array( array("1","2"), array("2","3"), array("3","1") ) now suppose I get some form inputs with the value 1 and 1. I am trying to find a way to figure out if the first coloumn is already in the table and if so just add the second coloumn to the first. I have tried various combinations of foreaches, in_array and array_search. Has anyone had a similar problem and found a soloution?

« previous php.general (#136514) next »