illegaljose Posted July 16, 2009 Share Posted July 16, 2009 Any way to set quantities to an include? meaning that I want to specify test1.php to run at a certain amount of times using a variable. <?php ini_set("display_errors","0"); include 'test1.php'; include 'test2.php'; include 'test3.php'; include 'test4.php'; ?> Link to comment https://forums.phpfreaks.com/topic/166175-include-quanity/ Share on other sites More sharing options...
trq Posted July 16, 2009 Share Posted July 16, 2009 Pardon? Link to comment https://forums.phpfreaks.com/topic/166175-include-quanity/#findComment-876308 Share on other sites More sharing options...
aschk Posted July 16, 2009 Share Posted July 16, 2009 Umm... Assuming test1.php contains a variable called "$myvar" Maybe something like this? <?php for($i=0; $i<5; $i++){ $myvar = "myvar equals {$i}"; include("test1.php"); } ?> The above code will "include" the content of test1.php 5 times, and change $myvar 5 times. What is it you're planning on putting in test1.php anyway? Link to comment https://forums.phpfreaks.com/topic/166175-include-quanity/#findComment-876384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.