PHP Velho Oeste 2024

preg_last_error_msg

(PHP 8)

preg_last_error_msgReturns the error message of the last PCRE regex execution

Descrierea

preg_last_error_msg ( ) : string

Returns the error message of the last PCRE regex execution.

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the error message on success, or "No error" if no error has occurred.

Exemple

Example #1 preg_last_error_msg() example

<?php

preg_match
('/(?:\D+|<\d+>)*[!?]/''foobar foobar foobar');

if (
preg_last_error() !== PREG_NO_ERROR) {
    echo 
preg_last_error_msg();
}

?>

Exemplul de mai sus va afișa:

Backtrack limit exhausted

A se vedea și

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top