I'm using a portable WAMP package "USB web server". It is giving error if i try to echo some variable directly, for example
<?php
echo $abc;
?>
The error i get is: "Notice: Undefined variable: abc "
This will work fine:
<?php
$abc = "foo";
echo $abc;
?>
Is it possible to fix this error? I am bound to use portable WAMP package as I do no thave administrator privileges, so i can not install any other package.
echoa variable before it was defined, as it does not exist. This is not an error, this is normal behaviour. So why do you doecho $abc?NULL, which will become the""empty string if printed out. The notice is just a by-product for debugging purposes, because typically that's not what you want. So, why do you want it?empty()orisset()before echoing it.