Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.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_Variables_Syntax - Fatal编程技术网

这段php代码是什么意思

这段php代码是什么意思,php,variables,syntax,Php,Variables,Syntax,您好,我是PHP新手,我不知道这段代码到底是什么意思 $de = array('Ä'=>'ae','ä'=>'ae','Ü'=>'ue','ü'=>'ue', 'Ö'=>'oe', 'ö'=>'oe', 'ß'=>'ss'); strtr($str, ${$de}); 我唯一需要知道的是${$de}是什么意思?这是php实现中最有趣的部分之一 有时有用,但总是令人困惑: $Bar = "a"; $Foo = "Bar"; $World = "Foo"

您好,我是PHP新手,我不知道这段代码到底是什么意思

$de = array('Ä'=>'ae','ä'=>'ae','Ü'=>'ue','ü'=>'ue', 'Ö'=>'oe', 'ö'=>'oe', 'ß'=>'ss');
 strtr($str, ${$de});
我唯一需要知道的是
${$de}
是什么意思?

这是php实现中最有趣的部分之一

有时有用,但总是令人困惑:

$Bar = "a";
$Foo = "Bar";
$World = "Foo";
$Hello = "World";
$a = "Hello";

$a; //Returns Hello
$$a; //Returns World
$$$a; //Returns Foo
$$$$a; //Returns Bar
$$$$$a; //Returns a
$$$$$$a; //Returns Hello
$$$$$$$a; //Returns World
....

这是一个变量


称为变量变量


“迷惑”是一个很好的表达方式。。。但是既然
$de
是一个数组,到底会发生什么?变量可以包含数组吗?它实际上做什么?我原以为这应该写成'strtr($str,$de)'——我希望间接寻址会导致警告和代码失败。