在PHP中,有以下幾種方式來定義數組:
$myArray = array("apple", "banana", "orange");
$myArray = ["apple", "banana", "orange"];
$numbers = range(1, 10);
$fruits = array("apple" => "red", "banana" => "yellow", "orange" => "orange");
$myArray = array("apple", "banana", "orange");
list($fruit1, $fruit2, $fruit3) = $myArray;