Change keys value in foreach PHP -


it possible change "keys" values in foreach php? example have database this:

http://i.imgur.com/fjawqgx.png

and want data, , display in:

foreach ($array $key => $value) { ...  } 

how can change "keys" if don't want display, example "u_group" "group"?

ps. sorry bad english ^ ^"

create language array, keys $key , value proper text.

e.g:

$langs = ['u_group' => 'group', 'u_other' => 'other']; foreach ($array $key => $value) {     echo 'user ' . $langs[$key] . ': ' . $value; } 

Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -