How to create array with array in it with PHP

1 Answer

0 votes
$arr = array("name" => "Al", 
             "age" => 63,
             "websites" => array("abc.com", "xyz.com", "uvw.com"),
             "city" => "New York");


print_r($arr);




/*
run:

Array
(
    [name] => Al
    [age] => 63
    [websites] => Array
        (
            [0] => abc.com
            [1] => xyz.com
            [2] => uvw.com
        )

    [city] => New York
)

*/

 



answered Jun 8, 2023 by avibootz
...