array_mapDescriptionarray array_map ( mixed callback, array arr1 [, array ...])array_map() returns an array containing all the elements of arr1 after applying the callback function to each one. The number of parameters that the callback function accepts should match the number of arrays passed to the array_map()
Usually when using two or more arrays, they should be of equal length because the callback function is applied in parallel to the corresponding elements. If the arrays are of unequal length, the shortest one will be extended with empty elements. An interesting use of this function is to construct an array of arrays, which can be easily performed by using NULL as the name of the callback function
The printout of the program above will be:
See also array_filter(), array_reduce(), and array_walk(). |
Ecommerce shopping carts Events management projects Affiliates systems Large sized web projects Real estate and vacation rental projects Asp.net and c# projects |
||||
|
Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 the PHP Documentation Group. Web design and webdevelopment and programming done by Software developers and web programmers
Web Design Copyright © 1999-2007. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |