I have the following code which works fine inline with my code:
if ($progressData[1] == "yes") {
echo "Complete";
}
else
echo "Not Yet Complete";
However, I would like to call it from a function:
function progressOutput () {
if ($progressData[1] == "yes") {
echo "Complete";
}
else
echo "Not Yet Complete";
}
When I call progressOutput()
, I get "Not Yet Complete", even though $progressData[1]
is equal to "yes".
Here is how I am calling the function:
Mission Status: <?php progressOutput(); ?>
What do I need to do to get progressOutput()
to return "Complete" when $progressData[1]
is in fact equal to "yes"?