Multiple array in php -


i wanted combine 3 arrays inside foreach,

$topic = explode(',',$data->topic); $description = explode(',',$data->description); foreach (array_combine($topic, $description) $topic => $description)  {   echo $topic;   echo $description; } 

which working 2 arrays, want 3 arrays, because want pass $id = explode(',',$data->id); in same array not possible using array_combine, can passing 3 arrays inside same foreach?

if id, topic , description in correct order in each comma delimited string supplying script, use following create single array key'd id:

$id = explode(',',$data->id); $topic = explode(',',$data->topic); $description = explode(',',$data->description);  foreach($id $key=>$val) {     $results[$val]['topic'] = $topic[$key];     $results[$val]['description'] = $description[$key]; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -