regex, match special char & one alpha

    Date: 12/11/07 (PHP Community)    Keywords: no keywords

    $x = " I?m having fun! ";
    $x = ereg_replace('[\?]', '\'', $x);

    echo $x = "I'm having fun!";


    $x = " I?m having fun! ";
    $x = ereg_replace('[\?m]', '\'', $x);
    echo $x = "I'' having fun!";


    I need to replace the question mark followed by a single alpha character. I don't understand how to match a ? followed by a character, as a group.

    Source: http://community.livejournal.com/php/602867.html

« Dream Weaver Issues || Passing in versus global... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home