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 #175292 is a reply to message #175291] Wed, 31 August 2011 22:48 Go to previous messageGo to previous message
A is currently offline  A
Messages: 17
Registered: June 2011
Karma:
Junior Member
> $newstring=preg_replace ("/â??/i", "",$newstring);

You didn't specify what these unknown characters should be.
I am guessing non-whitespace. In that case this would be appropriate:

$newstring=preg_replace ('/â\S\S/i', '',$newstring);

So that would match:
âabcer

But wouldn't match:
â asdasd

or...
âa sdasd

Note the "single" quotes (apostrophe) instead of your double quotes (that
don't need to escape backslash).

If you want to match anything then use:
$newstring=preg_replace ('/â../i', '',$newstring);

That would match any case of the above.
[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 09:47:56 GMT 2024

Total time taken to generate the page: 0.04861 seconds