HooligansInTheKitchen Posted March 3, 2007 Share Posted March 3, 2007 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 More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 are you using php5? What you are trying to do wouldn't work in php4 so you would want to use include(), but if it's php5 it probably should be fine (though I've never tried it). Link to comment https://forums.phpfreaks.com/topic/41032-require-in-while-loop/#findComment-198744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.