How to solve deprecated PHP

I try to solve an error:
Array and string offset access syntax with curly braces is deprecated

                for($x = 0, $y = strlen($data); !$bad && $x < $y; $x++)
                {
                    $bad = (ord($data{$x}) > 127);
                }

How to solve this PHP loop?

Change the curly braces to square ones.

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.