Page 1 of 1

Search script

Posted: Sat Jan 02, 2010 7:15 am
by Monotoko
I have extensively searched for some help on this matter, but all i can seem to find is classes for searching a directry for a file.

What im after is this:
A script which searches a file, namely another PHP file, and finds the start of something, which will be defined by:

Code: Select all

<?php
//start_header
?>
it will also have another line a couple of lines down:

Code: Select all

<?php
//end_header
?>
What i need, is to get everything inbetween them, put them into a variable, then put them somewhere else in the file...how would i go about that?

Re: Search script

Posted: Sat Jan 02, 2010 7:28 am
by manojsemwal1
use include("abc.php");

Re: Search script

Posted: Sat Jan 02, 2010 7:29 am
by Monotoko
but that will include everything, which is what i dont want to do as it is a theme file, so it echo's everything out.

I need to manipulate the file indirectly, just pull that little bit out into an array perhaps? rather than include it