Jump to content

include quanity?


illegaljose

Recommended Posts

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

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.