• [^] # Re: Autre solution sans regexp

    Posté par . En réponse au journal Convertir é en PHP. Évalué à 1.

    Sinon, ce code-ci me sort un truc propre :

    function filtertext ($string)
    {
    $string2 = html_entity_decode($string);
    $string3 = preg_replace('/&#([0-9]+);/ei', 'chr(intval(\'\1円\'))', $string2);
    $trans = array("&" => "&");
    $string4 = strtr($string3, $trans);
    return $string4;
    }