Hi guys.
In the php book I am currently reading, there is a snippet of code that doesn't make 100% sense to me:
<?php
if(!($handle = fopen("myfile.txt", "r"))) die("cannot open file");
?>
I understand what this code does and what it is for, but I don't understand why (in the book I am reading) it isn't typed up like this instead:
<?php
if(!$handle = fopen("myfile.txt", "r")) die("cannot open file");
?>
.... in other words, I don't get why (in the book I am reading) there needs to be extra parenthesis's:
if(!($handle = fopen("myfile.txt", "r")))
If I take them out and type it up like this:
if(!$handle = fopen("myfile.txt", "r"))
.... it appears to still work the same.
I don't understand why the extra parenthesis are even needed?
Paul.