Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #3046
| From | "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: php help |
| Date | 2011-09-01 10:44 +0200 |
| Organization | http://alvaro.es/ |
| Message-ID | <j3nglv$4vk$1@dont-email.me> (permalink) |
| References | <a69ee922-56bf-4e13-bc28-8a6db69c4701@o26g2000vbi.googlegroups.com> |
El 01/09/2011 0:23, bob escribió/wrote:
> I need some php help.
>
> I need to replaceâ followed by two unknown characters with an
> empty string.
>
> I tried this, but it's not quite right:
"Not quite right". Nice description. As useful as "Does not work" :)
>
>
> $newstring=preg_replace ("/â??/i", "",$newstring);
The "?" symbol means "any character" in Windows wildcards but not in
regular expressions. You want "." instead:
<?php
var_dump( preg_replace ('/â../i', '', 'âabKeep Me!') );
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
php help bob <bob@coolgroups.com> - 2011-08-31 15:23 -0700 Re: php help "A" <a@a.a> - 2011-09-01 00:48 +0200 Re: php help "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2011-09-01 10:44 +0200
csiph-web