Re: quick ereg() question
| From: | Bas Jobsen | Date: | Sat, 17 Aug 2002 21:42:42 +0000 |
| Subject: | Re: quick ereg() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113092@lists.php.net to get a copy of this message | ||
if (ereg("((\.)(php|inc))$",$o0o) && !ereg("\/\.\.", $o0o)){
Op zaterdag 17 augustus 2002 23:53, schreef eriol:
> I checked the manual and it's comments as well as google, but didn't find
> the simple answer i'm wanting..
>
> I have the following line in a "show php source code" page:
>
>
> if (ereg("(\.php)$",$o0o) && !ereg("\/\.\.", $o0o)){
> ...
> }
>
>
> It works fine on .php files but I was hoping I could include .inc files as
> well when someone wanted to view the source of them.. To include .inc files
> as viewable php source code, I'd rewrite it similar to below I assume, but
> I'm not understanding the syntax I'm missing..
>
>
> if (ereg("(\.inc | .php)$",$o0o) && !ereg("\/\.\.", $o0o)){
> ...
> }
>
>
> I know I have to use a pipe to seperate allowable file types, but that's
> the extent of what I know.. Any help would be appreciated.. TIA..
>
> Take care.. peace..
> eriol