代码示例:(标识:demo_php_array_num)
<!DOCTYPE html>
<html>
<body>

<?php
$cars=array("porsche","BMW","Volvo"); 
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>

</body>
</html>
运行结果: