Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.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_Kohana - Fatal编程技术网

php中奇怪的数组行为

php中奇怪的数组行为,php,kohana,Php,Kohana,我挠头是为了理解科哈纳。因此,如果合适的话,它要求在科哈纳的背景下处理我的问题。 在我的档案里,我在看一件奇怪的事情 'route' => '(<controller>(/<action>(/<keyword>(/<start>(/<limit>))))) //if i output this line i got noting but ((/(/(/(/))))) //it means angle brackets and w

我挠头是为了理解科哈纳。因此,如果合适的话,它要求在科哈纳的背景下处理我的问题。 在我的档案里,我在看一件奇怪的事情

'route' => '(<controller>(/<action>(/<keyword>(/<start>(/<limit>)))))
//if i output this line i got noting but  ((/(/(/(/)))))
//it means angle brackets and words between them are not shown.
'route'=>'((/(/(/(/))))
//如果我输出这一行,我什么也没有得到,但是((/(/(/))))
//这意味着没有显示尖括号和括号之间的文字。

现在我的问题是,在哪些情况下我们需要以这种方式编码。如果我们不需要尖括号和它们之间的单词,为什么我们要以这种方式工作。

这不是奇怪的行为

因为文档的默认内容类型是HTML,所以它会将文本解析为标记。为了避免这种情况,您必须使用函数进行回显,或者更改内容类型

echo htmlspecialchars($array['route']);

// or

header('Content-Type: text/plain');
echo $array['route'];
使用“查看源”。你听说过“HTML标签”这个词吗?