Answers for "create multidimensional array php for loop"

PHP
1

php foreach through multidimensional array

foreach ($rows as $row) {
    echo $row['id'];
    echo $row['firstname'];
    echo $row['lastname'];
}
Posted by: Guest on January-18-2021
-2

create multidimensional array php for loop

$result = array();
foreach($members as $member) {
    $result[] = array(
        'firstname' => $member['firstname'],
        'last_name' => $member['last_name'],
        'job' => $member['job'],
        'desc' => $member['desc'],
        'image_url' => $member['image_url']
    );
}
Posted by: Guest on February-18-2021

Code answers related to "create multidimensional array php for loop"

Browse Popular Code Answers by Language