array_search() on multidimensional array
Posted: Fri May 27, 2005 5:32 pm
I have a multidimensional array (thanks to Tim's concept) that I need to search for values on and can't quite get my brain into the correct gear to figure this out.
I then loop over every hour during the day and within that hour loop over every 15 minute interval. I need to use the values within my second for loop for the start time of that for loop and check it against the value for the start key in my second array. I thought about using array_search() to accomplish this, but can't think the logic through. Can someone either help me with that, or provide me with an alternative solution to extracting all of the data from the parent array's key if the child array's start key matches my increment value?
Code: Select all
<?
$getstuff = mysql_query("select * from 21_dates where date = '".$_GET['day']."' order by starttime")
or die(mysql_error());
$events = array();
while($gtstuff = mysql_fetch_assoc($getstuff)){
//create events array...burrito
$events[] = array('title'=>$gtstuff['eventtitle'],'start'=>$gtstuff['starttime'],'end'=>$gtstuff['endtime']);
}
?>I then loop over every hour during the day and within that hour loop over every 15 minute interval. I need to use the values within my second for loop for the start time of that for loop and check it against the value for the start key in my second array. I thought about using array_search() to accomplish this, but can't think the logic through. Can someone either help me with that, or provide me with an alternative solution to extracting all of the data from the parent array's key if the child array's start key matches my increment value?