[thelist] PHP: Associative Arrays

Donald Noble donald at drnoble.co.uk
Fri Jun 28 15:52:02 CDT 2002

Hi evolters,

If I have an array set up as follows:

$people = array(
	"Joe" => array ( "sname" => "Blogs", "age" => "32", "hates" =>
	"Mick" => array ( "sname" => "Mouse", "age" => "4", "hates" =>
	"Dave" => array ( "sname" => "Brown", "age" => "22", "hates" =>

how (if possible) can I check if there is an entry for Joe? ie I would
like to use something similar to if(in_array("Joe"),$people)...

the other question I have is, is there any way to easily get the
previous and next entries in such an array?

Cheers :Donald

 Hardware, Software & Custom built PC Systems

More information about the thelist mailing list