I use for PHP-coding Aptana Studio.
The following line gives me a syntax-error in Aptana-Studio:
<?php
if(isset($GLOBALS['errorSaveProfile'])) echo "<p>$GLOBALS['errorSaveProfile']</p>";
?>
But i don't understand why?
I use for PHP-coding Aptana Studio.
The following line gives me a syntax-error in Aptana-Studio:
<?php
if(isset($GLOBALS['errorSaveProfile'])) echo "<p>$GLOBALS['errorSaveProfile']</p>";
?>
But i don't understand why?
Don't use single quotes in double quotes for array keys: echo "<p>$GLOBALS[errorSaveProfile]</p>";
There are different correct ways:
print $_GLOBALS['errorSaveProfile'];
print 'something '.$_GLOBALS['errorSaveProfile'].' something';
print "something {$_GLOBALS['errorSaveProfile']} something";
See http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double and http://php.net/manual/en/language.types.string.php#language.types.string.parsing.simple
if(isset($GLOBALS['errorSaveProfile'])) {
echo "<p>$GLOBALS[errorSaveProfile]</p>";
}
try
echo "<p>"; echo $GLOBALS['errorSaveProfile']; echo "</p>";