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
array_merge vs just doing it [message #170287] Tue, 26 October 2010 23:13 Go to previous message
Brian Smither is currently offline  Brian Smither
Messages: 5
Registered: October 2010
Karma:
Junior Member
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?

Ex.1:

// Existing array
$lang['front']['area1']="This is prime.";
$lang['front']['area2']="This is sub-prime.";

// New elements
$modd['front']['loc3']="This is new.";
$modd['front']['loc4']="This is new, too.";

// merge the two
$lang = array_merge($lang,$modd);


Ex.2:

// Existing array
$lang['front']['area1']="This is prime.";
$lang['front']['area2']="This is sub-prime.";

// New elements
$lang['front']['loc3']="This is new.";
$lang['front']['loc4']="This is new, too.";

// it just is
[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 03:22:57 GMT 2024

Total time taken to generate the page: 0.04716 seconds