- print_r: documentation ( source)
- in_array: documentation ( source)
<?php
$food = array('fruits' => array('item1'=>'orange', 'item2'=>'banana', 'item3'=>'apple'),
'veggie' => array('item1'=>'carrot', 'item2'=>'collard', 'item3'=>'pea'));
print_r($food);
foreach($food as $item) {
echo $item["item1"]."<br >";
}
if(in_array('orange', $food, true)){
echo 'in array';
} else {
echo 'not in array';
}
$test_array=null;
echo count($test_array)."count of food ";
echo strlen("");