Answers for "compact to array"

PHP
0

compact to array

$clothes = 't-shirt';
$size = 'medium';
$color = 'blue';
 
$array = compact('clothes', 'size', 'color');
print_r($array);
 
// Array
// (
//     [clothes] => t-shirt
//     [size] => medium
//     [color] => blue
// )
Posted by: Guest on May-22-2021

Browse Popular Code Answers by Language