Re: Need a simple one time search utility
| From: | Philip Thompson | Date: | Mon, 14 Apr 2008 18:48:37 +0000 |
| Subject: | Re: Need a simple one time search utility | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-272984@lists.php.net to get a copy of this message | ||
On Mon, Apr 14, 2008 at 12:15 PM, Daniel Brown <parasane@gmail.com> wrote:
> On Sat, Apr 12, 2008 at 3:13 PM, Al <news@ridersite.org> wrote:
> > I need a simple utility that simulates GREP to find a certain string in
> any
> > php files on my website.
> >
> > Site is on a shared host w/o shell access so I can't run GREP.
> >
> > I can write a PHP scrip to do it; but, this is a one time thing and I
> was
> > hoping to find something to save me the effort.
>
> Al,
>
> For yourself and others searching for the same type of thing in
> the future, I threw this script together. There's always room for
> improvement, but it's a fully-functional trunk with which to start.
> All native PHP functions, no external exec() access required. Full
> source linked from the bottom of the page.
>
> http://pilotpig.net/code-library/recursive-grep.php
<?php
$stringSoMyStatsWillIncrease = "
I know it's only a demo, but there is a small error. You have this string
spit out:
Sorry, for this demo, only the word
pilopig is allowed as a search string.
However, in the if() statement, you test for 'pilotpig'. Small misspelling.
=D
";
?>
~Philip