quick ereg() question

From: Date: Sat, 17 Aug 2002 21:53:41 +0000
Subject: quick ereg() question
Groups: php.general 
Request: Send a blank email to php-general+get-113091@lists.php.net to get a copy of this message
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

« previous php.general (#113091) next »