Answers for "php array add string to each value"

PHP
1

array push foreach php

$items = array();
foreach($group_membership as $username) {
 $items[] = $username;
}

print_r($items);
Posted by: Guest on September-02-2020
0

php add to array in loop

array:3 [▼
  0 => array:4 [▼
    0 => "mon"
    1 => "wed"
    2 => "thu"
    3 => "sat"
  ]
  1 => array:3 [▼
    0 => "sun"
    1 => "tue"
    2 => "fri"
  ]
  2 => array:1 [▼
    0 => "fri"
  ]
]
Posted by: Guest on January-31-2022

Browse Popular Code Answers by Language