Hi,
I have a question about PHP's in_array() function. Is there any way to have this function search for a particular value within an array that is inside another array? Here's some code to further explain my question:
$userArray = array(
array("userName" => "jtodd", "firstName" => "James", "lastName" => "Todd"),
array("userName" => "speters", "firstName" => "Sam", "lastName" => "Peters"),
array("userName" => "tdunn", "firstName" => "Ted", "lastName" => "Dunn"),
array("userName" => "bkyle", "firstName" => "Bill", "lastName" => "Kyle")
);
if (in_array("tdunn", $userArray)) {
print "User found!";
}
Is there any way to use the in_array() function to search for a value of a sub array, or would I have to foreach() the $userArray variable and check every sub array with it's own in_array() function call?