How do I put an if statement within an if statement? Right now it’s like this;
<?php
if($var1===$var2)
{
if($condition1 > 0)
{
*lots of code here*
}
}
else
{
*lots of code here again*
}
}
?>
Meaning that I want $condition1 to be bigger than 0 IF $var1 does not match $var2. But as it stands I am duplicating the “lots of code part” so I just want to;
if($var1!=$var2){ -apply if statement- }
*lots of code here*
if($var1!=$var2){ -close if statement- }
But how?
1 Answer