News:

Wondering if this will always be free?  See why free is better.

Main Menu

[solved] echo <<<EOT with array element

Started by andrea, September 19, 2004, 10:50:15 AM

Previous topic - Next topic

andrea

Why does this code cause a parse error?


<?php

echo <<<EOT
some text $somearray['somekey'] again some text
EOT;


?>



I tried already to leave the ' characters out or to put a backslash before them, which did not cause correct execution of the script.

Andrea Hubacher
Ex Lead Support Specialist
www.simplemachines.org

Personal Signature:
Most recent work:
10 Aqua Themes for SMF



Saleh

it works for me when I use the braces:

<?PHP

echo <<<EOT
some text {$somearray['somekey']} again some text
EOT;

We don't need a reason to help people

andrea


Andrea Hubacher
Ex Lead Support Specialist
www.simplemachines.org

Personal Signature:
Most recent work:
10 Aqua Themes for SMF



Advertisement: