Re: Regex problems.....

From: Date: Thu, 22 Feb 2001 23:15:01 +0000
Subject: Re: Regex problems.....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41234@lists.php.net to get a copy of this message
You should either do this with ereg, or strtolower and not a combination of the two, and in all actuality strtolower is specifically desinged to do this very easily so I would go with it. <? $contents="<img src=ThisOneReallyNeedsToBeAllLowercase.gif alt=ThisOneReallyNeedsToBeAllLowercase.gif>"; $contents = strtolower($contents); ?> Should do what you want. -- phill "Ian LeBlanc" <ian@his-way.com> wrote in message news:5.0.2.1.0.20010222180420.00ae4ea8@his-way.com... > Guys/Gals: > > For some reason too long to explane .. i have this site that i need to make > all the image names in an > image src all lowercase.. Here is what I have so far. Please someone tell > me what I am doing wrong. > > <? > $contents="<img src=ThisOneReallyNeedsToBeAllLowercase.gif > alt=ThisOneReallyNeedsToBeAllLowercase.gif>"; > $contents = EREG_REPLACE("([-_a-zA-Z0-9]+).gif",strtolower("\\0"),$contents); > ?> > > Output of $contents needs to equal > > <img src=thisonereallyneedstobealllowercase.gif > alt=thisonereallyneedstobealllowercase.gif> > > > I have the top part of my script reading the whole DIR and only editing the > HTML files so > that part is taken care of All I need it help with making the images tag > all lower case. > Ian LeBlanc > 2tonecafe.com Admin > 727-517-3866 > > > > You can have yourname@2tonecafe.com free too. Apply today! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#41234) next »