Jump to content

array


dreamwest

Recommended Posts

Ive drawn some database info but i need to change one key value

while ($new = mysql_fetch_assoc($res)){
    $latest[] = $new;
}
print_r($latest);

 

 

which prints:

Array ( 

[0] => Array ( 
[id] => 1063636 
[vid] => 41321 
[es_title] => another title
)

[1] => Array ( 
[id] => 1063635 
[vid] => 02003 
[es_title] => another title
)

[2] => Array ( 
[id] => 1063634 
[vid] => 51605 
[es_title] => another title
)
) 

 

How can i replace [es_title] with just [title] so it looks like this

Array ( 

[0] => Array ( 
[id] => 1063636 
[vid] => 41321 
[title] => another title
)

[1] => Array ( 
[id] => 1063635 
[vid] => 02003 
[title] => another title
)

[2] => Array ( 
[id] => 1063634 
[vid] => 51605 
[title] => another title
)
) 

 

 

Link to comment
https://forums.phpfreaks.com/topic/234016-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.