Linked Questions

2 votes
4 answers
4k views

Possible Duplicate: In PHP, how do you change the key of an array element? I am reading in a bunch of multi-dimensional arrays, and while digging through them I have noticed that some of the keys ...
Evernoob's user avatar
  • 5,571
4 votes
2 answers
477 views

Possible Duplicate: In PHP, how do you change the key of an array element? This the array Array ( [0] => Array ( [id] => 1 [due_date] => 2011-09-23 ...
Gihan Lasita's user avatar
  • 3,073
1 vote
3 answers
3k views

I am trying to overwrite [19] in my array, the first value every time. [19] will not always be the same as it populates off an ID that is passed into the array. I want to replace that first index with ...
q_w_d's user avatar
  • 31
0 votes
3 answers
360 views

I start with a MySQL query (not of my design) that returns results that look like: $row['user_name']; $row['user_property'] $row['user_property_2'] $row['day_1'] $row['day_2'] $row['day_3'] $...
Anthony's user avatar
  • 37.2k
-2 votes
1 answer
836 views

How can i change an index of an array in php? for example $myArray = {"x","y","z","w"}; I want to change the index of myArray [2] to myArray ["two"]
levenzer's user avatar
0 votes
2 answers
540 views

Let's say we have the following dataset: $data = [ 'Newcastle Upon Tyne, Tyne and Wear, England' => 18, 'Gateshead, Tyne and Wear, England' => 17, 'Sunderland, Tyne and Wear, England' =&...
Jack Robson's user avatar
  • 2,302
0 votes
1 answer
349 views

I have been looking or a way to change an objects key name with no success as of yet. I need to be able to parse ALL through the keys in the resulting set, check the name of the key, and assign it a ...
Moorsie's user avatar
  • 31
1 vote
1 answer
238 views

I have this array that i need to edit the array : Array ( [E:\EasyPHP-cmsServer-14.1VC9\data\cms\sites\user_1\012014.user_1.txt] => TotalVisits 6788 [E:\EasyPHP-cmsServer-14.1VC9\data\...
SpencerX's user avatar
  • 5,741
1 vote
3 answers
72 views

There is a given array and array to map on. What I try to get is if the keys from given is like the key from map I would like the key from given to become the value from map. Example: the given array ...
caramba's user avatar
  • 22.5k
0 votes
1 answer
235 views

i want to change the key. this is the output once i submitted the form. Array ( [year] => 1 [event_name] => 2 [Sno] => 6 [First_name] => kodeesswaran [Last_name] =...
user2715480's user avatar
-1 votes
2 answers
231 views

I have this array $the_posted = Array ( 0 => Array ( 0 => 1, 1 => 2, 2 => 3, 3 => 4, ), 1 => ...
You Know Nothing Jon Snow's user avatar
0 votes
2 answers
81 views

i have a array - the output of my array looks like this: Array ( ["US"] => 186 ["DE"] => 44 ["BR"] => 15 ["-"] => 7 ["FR"] => 3 ) and i want to replace the "-" with ...
PHPprogrammer42's user avatar
0 votes
0 answers
33 views

This is not the same question as "Replace keys in an array based on another lookup/mapping array" because the map array does not use numerical keys. I am being given json data from a third ...
startingout's user avatar
637 votes
23 answers
590k views

How can I insert a new item into an array on any position, for example in the middle of array?
kusanagi's user avatar
  • 14.6k
79 votes
14 answers
198k views

When I var_dump on a variable called $tags (a multidimensional array) I get this: Array ( [0] => Array ( [name] => tabbing [url] => tabbing ) [1] => ...
user avatar

15 30 50 per page