Using include() Within a Loop : include « Utility Function « PHP
- PHP
- Utility Function
- include
Using include() Within a Loop
<html>
<head>
<title>Using include() Within a Loop</title>
</head>
<body>
<div>
<?php
for ( $x=1; $x<=3; $x++ ) {
$incfile = "incfile".$x.".txt";
print "<p>";
print "Attempting include $incfile<br/>";
include( "$incfile" );
print "</p>";
}
?>
</div>
</body>
</html>
Related examples in the same category