Re: preg_replace
| From: | Scott | Date: | Mon, 11 Feb 2002 18:54:51 +0000 |
| Subject: | Re: preg_replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-84308@lists.php.net to get a copy of this message | ||
Man, I need more caffine, I fixed it doing this:
$replace_char = array("-",".",":");
$replace_strings = array("","","");
$fields = split("\t",$quote[$s]);
$fields = str_replace($replace_char, $replace_strings, $fields);
Thanks to everyone! You have been very patient with me.
-Scott
On Mon, 11 Feb 2002, Scott wrote:
> I tried that, but no luck, here is my code:
>
> for ($s=0; $s<=count($quote)-1; $s++){
> $fields = str_replace("-", "", $quote[$s]);
> $fields = split("\t",$quote[$s]);
>
> -Scott
>
>
>
>
>
>
> On Mon, 11 Feb 2002, val petruchek wrote:
>
> > Why not use str_replace() or just pasre th? string with single for(;;) ?
> > Valentin Petruchek (aki Zliy Pes)
> > *** Cutthe beginning ***
> > http://zliypes.com.ua
> > mailto:val@zliypes.com.ua
> > ----- Original Message -----
> > From: "Scott" <scott@scottah.com>
> > To: <php-general@lists.php.net>
> > Sent: Monday, February 11, 2002 7:14 PM
> > Subject: [PHP] preg_replace
> >
> >
> > > Can someone guide me on preg-replace (or other option). I have an array
> > > that I am splitting, but before I do that I want to remove all dashes(-),
> > > periods (.) and colons (;). Here is what I tried:
> > >
> > > $fields = preg_match_all("[.:-]", "", $policy[$p]);
> > >
> > > When I do everything remains in the file, is there a perl similar //g
> > > global switch I might be missing.
> > >
> > > Thanks,
> > >
> > > -Scott
> > >
> > >
> > >
> > >
> > > --
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >
> >
> >
>
>
--