PHP include file with numbers -
i want include files in webpage, pages this: new1.php new2.php
the number increasing , want include files new(a number).php don't know how , can't find elsewhere.
now have :
<?php include('includes/new1.php'); ?> <?php include('includes/new2.php'); ?> <?php include('includes/new3.php'); ?> <?php include('includes/new4.php'); ?>
but lot of work include them hand. there way include files without doing lot of work?
thanks in advance!
this include 10 files you.
for ($i = 1 ; $i <= 10 ; $i++){ include("includes/new{$i}.php"); }
also, specify numbers in array if have no common pattern or order.
$numbers = array(1, 15, 12, 35, 234) ; foreach($numbers $number){ include("includes/new{$number}.php"); }
Comments
Post a Comment