Jump to content

Won't enter if statement


Recommended Posts

This is a file called f2.php

<?php

$noError = 0;

echo"Test 1 Passed</br>";

?>

 

This is a different file called f1.php

<?php include 'f2.php';?>

<?php

echo"Test 2 Passed</br>";

if($noError = 0)

{

echo"Test 3 Passed";

}

?>

 

 

Test 1 and 2 passed. $noError was equal to 0 both times.  But it's not going into the If statement. The value of $noError has not changed. It is still 0. Why the is it not going into Test 3?

 

Link to comment
https://forums.phpfreaks.com/topic/277608-wont-enter-if-statement/
Share on other sites

Archived

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

×
×
  • Create New...

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.