Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);
// 简单数组:
$array = array(1, 2);
print_r($array);
echo PHP_EOL;
$count = count($array);
echo '$count: '.$count;
echo PHP_EOL;
for ($i = 0; $i < $count; $i++) {
echo "\n检查 $i: \n";
echo "\n坏的: " . $array['$i'] . "\n";
echo "\n好的: " . $array[$i] . "\n";
echo "\n坏的: {$array['$i']}\n";
echo "\n好的: {$array[$i]}\n";
echo PHP_EOL;
}
?>