<?php
$myVariable="yes";
if ($myVariable == "yes") $yesORno="yes";
else
$yesORno="no";
if ($myVariable == "yes") include "yes.php";
else
include "no.php";
?>
I have the code above.
If the value of $myVariable is “yes,”
The value of $yesORno will be “yes” and it includes “yes.php.”
I like to use “if” just one time for it.
The code below is one of my trials for it. But it doesn’t work as I expected.
<?php
$myVariable="yes";
if ($myVariable == "yes")
$yesORno="yes";
include "yes.php";
else
$yesORno="no";
include "no.php";
?>