PHP: Set variable in to include file in 'if' statement
- by swiftsly
I am trying to set a variable in an 'if' statement so that only when the 'if' statement is true, the variable will be set and will be able to be used somewhere else on the page.
Here's what I have tried:
if ($row[8] == 1) {
echo 'Message here';
ob_start();
include('F164.php');
$f164 = ob_get_clean();
}
as well as:
if ($row[8] == 1) {
echo 'Message here';
$f164 = include('F164.php');
}