|
Posted by shimmyshack on 05/16/07 09:52
On May 16, 10:05 am, UKuser <spiderc...@yahoo.co.uk> wrote:
> On 16 May, 09:52, "Rami Elomaa" <rami.elo...@gmail.com> wrote:
>
>
>
> > "UKuser" <spiderc...@yahoo.co.uk> wrote in message
>
> >news:1179305059.030405.170200@q23g2000hsg.googlegroups.com...
>
> > > Hi,
>
> > > Is there a way to shorten this line
>
> > > if ((ereg(".jpg",$filename))||(ereg(".eps",$filename))||(ereg(".tif",
> > > $filename))||(ereg(".tiff",$filename))||(ereg(".jpeg",$filename))||
> > > (ereg(".ai",$filename))) {
>
> > if(preg_match('#.+\.(jpg|jpeg|eps|tif|tiff|ai)$#', $filename)){
>
> > --
> > Rami.Elo...@gmail.com
>
> > "Good tea. Nice house." -- Worf
>
> Thanks for that!
>
> A
you can still shorten it a teeny bit more, by
\.(jpe?g|eps|tiff?|ai)$
instead of
..+\.(jpg|jpeg|eps|tif|tiff|ai)$
buy hey who cares right
Navigation:
[Reply to this message]
|