RE: [PHP] whats wrong with this?
| From: | Liam dot Gibbs at dfait-maeci dot gc dot ca | Date: | Wed, 28 Aug 2002 16:12:22 +0000 |
| Subject: | RE: [PHP] whats wrong with this? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114381@lists.php.net to get a copy of this message | ||
(1) for($day = 1; $day < 32; $day++){
(2) if($day = $system_day){
(3) echo "match!";
(4) }
.
.
.
Easy enough. One of those things the programmer may not spot, but a casual
observer might. In line #2, you have a single =. A comparative = is a double
equal (==). The line should read "if($day == $system_day){". A single equal
will assign the value; a double equal will compare the two.