This is my code:
<?PHP
echo "hello";
$array = (
"hi" => "ho"
"li" => "lo"
);
echo "hi";
echo ($array["hi"]);
?>
This displays nothing when loaded on the browser. When removing everything that has to do with $array, the browser displayes “hellohi”. Am I doing something wrong? Server is Apache/2.2.3 (Red Hat) running PHP Version 5.1.6. Updating or altering anything in the server is impossible.
Thanks!
You have a few syntax errors in your code. Try the following code:
You were declaring the array wrong (see manual), you forgot array(). You were also missing the comma between the array elements.