I have a got an initially defined associative array.
I want to add elements to it (key, value pair) when required.
so looking for an equivalent of array_push() or any easiest way to do it.
ex:
initially
$tempArray = array("john"=>"millers")
after some time I want to add
"peter" => "wright"
Is there a easy way to push into associative array???
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
Is there a reason why
wouldn't work?
Code: Select all
$tempAray["Peter"]="Wright";- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
raghavan20, when you're posting, please make sure(!!!) that you're using
Code: Select all
tags around code.