FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » array_merge vs just doing it
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: array_merge vs just doing it [message #170296 is a reply to message #170287] Wed, 27 October 2010 10:14 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
El 27/10/2010 1:13, Brian Smither escribió/wrote:
> I've studied array_merge and I know what it does regarding disparate
> key/value pairs.
>
> But what is the "strategy" of using array_merge when just assigning
> key/values to the array would work just as well?

Almost all native functions can be replaced with ad-hoc alternatives
coded in plain PHP. Functions basically exist for your convenience so
you don't have to waste time reinventing the wheel and pasting the same
blocks of code again and again. In these case, I find it useful to be
able to merge arrays without the need of writing nested foreach loops
every time.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Php windows system(whois) not working
Next Topic: Study Abroad Scholarship For Study in Australia...
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 14 05:18:07 GMT 2024

Total time taken to generate the page: 0.04157 seconds