lib.php:
<?php
function get_time() {
loop = true;
while (loop) {
echo date("F j, Y, g:i a");
}
}
?>
index.php contains this:
<?php
include("lib.php");
?>
and this somewhere further down:
<?php
get_time();
?>
However, I don't see anything.
So I see two potential problems here. Either I need to declare the include() at the same time as I declare the function. Or PHP is unable to display continuous data (like in the case of this while loop) on a webpage without refreshing.
If it's the former, is there a way to declare the include() globally for my whole page? If it's the latter, how can I get it to show the contents of a continuous loop on my page? Will I have to use another language? Thanks
include(), which will not abort execution iflib.phpcannot be found. Turn on error_reporting and display_errors to see what shows up.$before PHP variables.$loop = truenotloop = true;