Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php内置函数转换文本中的十六进制字符_Php_Hex_Decode_Encode - Fatal编程技术网

使用php内置函数转换文本中的十六进制字符

使用php内置函数转换文本中的十六进制字符,php,hex,decode,encode,Php,Hex,Decode,Encode,是否有一个内置的PHP函数来转换文本中的十六进制字符 这: 到 您无事可做,\x7B和\x7D已被解释为双引号之间的{和} \x7B是{ \x7D是} 一个字符可以在双引号之间或使用heredoc语法(文字、十六进制、八进制)具有多个表示形式 尝试: 和(十六进制) 或(八进制) $encoded="this is \x7Btext\x7D"; $decoded="this is {text}"; echo "this is \x7Btext\x7D this is {text} this

是否有一个内置的PHP函数来转换文本中的十六进制字符

这:


您无事可做,
\x7B
\x7D
已被解释为双引号之间的
{
}

\x7B
{

\x7D
}

一个字符可以在双引号之间或使用heredoc语法(文字、十六进制、八进制)具有多个表示形式

尝试:

和(十六进制)

或(八进制)

$encoded="this is \x7Btext\x7D";
$decoded="this is {text}";
echo "this is \x7Btext\x7D this is {text} this is \173text\175";
var_dump("this is \x7Btext\x7D" === "this is {text}");
var_dump("this is \173text\175" === "this is {text}");