Re: Scan files
| From: | shaun | Date: | Fri, 16 May 2003 18:42:42 +0000 |
| Subject: | Re: Scan files | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147958@lists.php.net to get a copy of this message | ||
Ok I think I'm nearly there
but the following isn't picking up the files that contain the tags:
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && is_file($file)) {
if(strpos(fopen($file, r), '<!-- isEditable !-->') == true){
echo $file.'<br>';
}
}
}
closedir($handle);
}
?>
Any ideas?
"Cpt John W. Holmes" <holmes072000@charter.net> wrote in message
news:000701c31bd9$d8940ba0$a629089b@TBHHCCDR...
> And strpos() is best because you're looking for a string and not a
pattern.
>
> ---John Holmes...
>
> > preg_match() is better
> >
> > Burhan Khalid wrote:
> >
> > >Hello shaun,
> > >
> > >Friday, May 16, 2003, 11:40:35 AM, you wrote:
> > >
> > >s> Hi,
> > >
> > >s> I am trying to build a content management facility into my site, is
> there a
> > >s> PHP command that allows me to scan for a certain tag say <!--
> > >isEditable=true --!>> and <!-- isEditable=false --!>
> > >
> > >http://www.php.net/eregi
>