vendredi 7 août 2020

PHP get if variable is a pattern/regex

Is there a way to detect if a variable is a pattern in PHP? I know this is possible in JavaScript since patterns are a variable type however in PHP, patterns are inside of strings.

if (is_pattern($myPattern)) {
        //...
}

Aucun commentaire:

Enregistrer un commentaire