Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3046

Re: php help

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>

Show all headers | View raw


El 01/09/2011 0:23, bob escribió/wrote:
> I need some php help.
>
> I need to replace&acirc; 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 ("/&acirc;??/i", "",$newstring);

The "?" symbol means "any character" in Windows wildcards but not in 
regular expressions. You want "." instead:

<?php
var_dump( preg_replace ('/&acirc;../i', '', '&acirc;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


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