在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;