Below function works well in PHP 7.2.24.
now trying the same in PHP 8.1.2, I am encountering following error:
Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated.
please let me know what is to be changed.
thanks in advance!!
Code:
public function escapeLike($string) {
return addcslashes($string, '\%_');
}
Deprecated function: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated.
please let me know what is to be changed.
thanks in advance!!