Codeasearch.com - Search your code with us Login | Register | Contact us
  Forums > Php > Array example
balaji
Posted on Jun 1, 2009
Join Date: February 2009
Location: India ( chennai )
Posts: 9
 
Array example  

please kindly help me with array_walk_recursive function with an example.....

benaya
Posted on Jun 1, 2009
Join Date: June 2007
Location: India ( Chennai )
Posts: 90
 
RE : Array example  

<?php
//array_walk_recursive a user function recursively to every member of an array

$sweet = array('a' => 'apple', 'b' => 'banana');
$fruits = array('sweet' => $sweet, 'sour' => 'lemon');

function test_print($item, $key)
{
echo "$key holds $item\n";
}

array_walk_recursive($fruits, 'test_print');

//You may notice that the key 'sweet' is never displayed. Any key that holds an array will not be passed to the function.
?>


 Hot Discussion
Go Tech launches Android tablet for Rs 3,999...
Sony targets retailers with quick sales pitches and rew...
Share and discover new activities with Google Schemer...
Samsung gets 9 mn preorders for Galaxy S3: Report...
Google revamps search engine to think like a person...
 
 Discussion Topics
IT News
Php
Javascript
Technology Updates
Asp.Net
MySql
Ajax
Html
Fedora
Software Testing
Asp
Java
General
Flash
Ruby on Rails