Search script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Search script

Post 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?
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

Re: Search script

Post by manojsemwal1 »

use include("abc.php");
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Re: Search script

Post 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
Post Reply