\\ $DigitalSignature have full name value passed
$SignatureMatch = '/' . strtolower( $NameFirst . ' ' . $NameLast ) . '$/';
if( true == preg_match( $SignatureMatch, strtolower( $DigitalSignature ) ) )
{
$boolIsValid = true;
}
I am having this code for exact matching first name and last name match with digital signature. But this gives error reported me in error log on production(live).
preg_match(): Unknown modifier 'b'
I am unable to reproduce this error. How can I get this error firstly. And how to resolve this error for exact matching.
I have seen many questions on SO but not getting when will get this error. And how do I resolve that. Some of questions out of many I have saw are -
If the first name or last name contains a /, your regex will look something like:
/john/doe$/
To preg_match, this looks like the regex is /john/, with the trailing doe$/ being the modifiers. Those are of course invalid modifiers. You need to escape the regex delimiters (/) inside the regex itself using preg_quote.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With