Hi how can i read the value of on an element in array with known key. eg array -> My array is a- apple ,b -ball ,c-cat If i know the key 'b' and want to know its value ,what is the function available. I could find any.
Thanks.
$foo=array('a'=>'apple' ,'b' =>'ball' ,'c'=>'cat'); echo $foo['a']; //returns apple
As well as being able to print if you know the array keys, you can call array_keys() to grab the keys of an array, and interact using them.