Jump to content

Require() in while loop


Recommended Posts

I want to require a file during a while loop, and each loop have the file executed again. From the php documentation it seems like require() should be able to do this, as it says to use require_once() if I don't want the file to be repeatedly executed. However, my loop breaks everytime it gets to the require() statement a second time. Is this a config issue, or is there another function i can use?

 

code:

 

<?php

while(true)

{

echo "looping\n";

require('popper.php');

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/41032-require-in-while-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.