Re: Is it possible to parse a variable by character?
| From: | Christian Reiniger | Date: | Wed, 18 Apr 2001 12:10:49 +0000 |
| Subject: | Re: Is it possible to parse a variable by character? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49194@lists.php.net to get a copy of this message | ||
On Wednesday 18 April 2001 12:00, you wrote:
> >Warning: REG_ERANGE in
> > /home/httpd/www/worldvibe.org/digitall/edit_f.php on line 91
> >
> >Here are lines surrounding 91:
> >
> >89-> strtolower($f_loc_name);
> >90-> $f_loc_new = "";
> >91-> $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "",
> >$f_loc_name);
> >92-> $f_loc_name = "";
> >93-> $f_loc_name = $f_loc_new;
>
> $f_loc_new = ereg_replace("[^_a-z0-9-\.]", "", $f_loc_name);
That, and because the dash needs to be the last character in the
character class:
$f_loc_new = ereg_replace("[^_a-z0-9.-]", "", $f_loc_name);
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
AAAAA - American Association Against Acronym Abuse