update page now
Longhorn PHP 2026 - Call For Papers

Voting

: max(three, two)?
(Example: nine)

The Note You're Voting On

andre at koethur dot de
12 years ago
Here is a more advanced function to convert an error code to text:

<?php

function preg_errtxt($errcode)
{
    static $errtext;

    if (!isset($errtxt))
    {
        $errtext = array();
        $constants = get_defined_constants(true);
        foreach ($constants['pcre'] as $c => $n) if (preg_match('/_ERROR$/', $c)) $errtext[$n] = $c;
    }

    return array_key_exists($errcode, $errtext)? $errtext[$errcode] : NULL;
}

?>

<< Back to user notes page

To Top