I want to be able to include lines from another file, but not just to write the exact line, but if there is an include 'file.txt'; for the whole thing to include that, so far i have this:
I want to include the first 5 lines
In - home-news-new-parts.php
<?php
include 'home/news/news-pieces.php';
for ($i=0;$i<5;$i++) {
print $file[$i];
}
?>
In news-pieces.php
<?php
include 'home/news/news/test.php';
include 'home/news/news/news-piece1.php';
include 'home/news/news/news-piece2.php';
include 'home/news/news/news-piece3.php';
include 'home/news/news/news-piece4.php';
include 'home/news/news/news-piece5.php';
include 'home/news/news/news-piece6.php';
include 'home/news/news/news-piece7.php';
?>
This works but lists more than the first 5 lines, it carrys on going till the end of it
It should only list news-piece1-5, not 6 or 7, but it does, plz help me!