Convert Unicode hex to decimals in PHP 7.4

Viewed 691

The following if-condition executes as expected:

    if (hexdec($range[0]) < $char && $char < hexdec($range[1])) {

however giving the following notice in PHP 7.4:

Deprecated function: Invalid characters passed for attempted conversion, these have been ignored in

because as https://www.php.net/manual/en/function.hexdec.php states:

As of PHP 7.4.0 supplying any invalid characters is deprecated.

I don't have control over supplied characters - if they are valid or not. Any ideas on how to re-write the above code to avoid the Deprecated function notice?

0 Answers
Related