What is x7f and xff in php?
Is it hexa or octal values?
EDIT:
It is given in PHP 5.3 manual that, as a regular expression, class name would be expressed as: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
can any one help what is the meaning of \x7f-\xff in above regular expression?
Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in a program. A function will not execute immediately when a page loads. A function will be executed by a call to the function.
In PHP 7, type declarations were added. This gives us an option to specify the expected data type when declaring a function, and by adding the strict declaration, it will throw a "Fatal Error" if the data type mismatches. In the following example we try to send both a number and a string to the function without using strict:
PHP has more than 1000 built-in functions, and in addition you can create your own custom functions. PHP has over 1000 built-in functions that can be called directly, from within a script, to perform a specific task. Please check out our PHP reference for a complete overview of the PHP built-in functions.
As per the integer page on PHP.net, the format of hex in PHP is:
hexadecimal : 0[xX][0-9a-fA-F]+
thus it's hex.
As other stated its x7f
& xff
are hexadecimal code which corresponds to extended ASCII characters that can be added as part of class name in php. ASCII Codes
The 0x
prefix (not just x
) means hexadecimal, so 0x7f is 127 and 0xff is 255.
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