0

In PHP manual stated that

\u{[0-9A-Fa-f]+} the sequence of characters matching the regular expression is a Unicode codepoint, which will be output to the string as that codepoint's UTF-8 representation (added in PHP 7.0.0)

echo "\101";  //Output A

echo "\x41";  // Output A

echo "\u0041"; //But its now working. output same as \u0041

i am unable to understand \u

Dhairya Lakhera
  • 4,445
  • 3
  • 35
  • 62

1 Answers1

0

I suggest to read through this well explaining blog post of the current CEO of stackoverflow (funny coincidence).

Basically to quote the relevant part (about the "u"):

The U+ means “Unicode” and the numbers are hexadecimal. U+0639 is the Arabic letter Ain. The English letter A would be U+0041.

UPDATE

Your problem seems actually connected to a missing implementation between PHP 7.0 and PHP 7.2 -> Read this SO-Answer here

Ernst Zwingli
  • 1,402
  • 1
  • 8
  • 24