Jump to content

Archived

This topic is now archived and is closed to further replies.

spyke01

Another silly question

Recommended Posts

Looking to see why this would have been done

[code]
<?=@$amount?>
[/code]

i know its echoing, but why the @ before the variable, here the places that amount is $defined

[code]
$amount = $qr['amount'];
$amount = $amount * $_POST['no_credits'];
[/code]

Share this post


Link to post
Share on other sites
The @ symbol supresses error messages. For example if $amount didn't exist you might get this error:
[b]Notice: Undefined variable: amount in [path to script] on line [line number here][/b]
When you use the @ symbol infront of the $amount variable, the error message will not be shown.

Share this post


Link to post
Share on other sites
ahh ok cool, seen it with DB quieries, but never with echoes, thanks mate

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.