FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php help [message #175297 is a reply to message #175291] Thu, 01 September 2011 08:44 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma:
Senior Member
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 ('/&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
--
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: try / catch or INSERT INTO... ON DUPLICATE KEY UPDATE
Next Topic: PHP script to only be accessed by cron
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 06:56:56 GMT 2024

Total time taken to generate the page: 0.06727 seconds