【发布时间】:2018-06-29 00:08:45
【问题描述】:
//include.php?filepath=theme.php (string)
//include.php?filepath=0 (int)
//include.php?filepath=[] (null)
$file = $_GET['filepath'];
if ($file != "theme.php")
{
die("error file is not a theme");
}
include($file);
在上面的代码中,sn -p 第 2 行的比较是什么?字符串 VS 字符串还是字符串 VS 整数?
换句话说,$_GET['x'] 会返回什么?
【问题讨论】:
-
它总是一个字符串
-
@YouneL 你能给出一个总是如此的概念证明吗?我在文档中的任何地方都找不到它
-
嗯,$_GET 是一个由查询字符串产生的关联数组
-
@AK_,参见$_GET 描述页面。它有一个注释,“GET 变量是通过 urldecode() 传递的”。而
urldecode函数总是返回一个字符串。 -
@SergeyRonin 这回答了我的问题。您能否将其发布为包含所有详细信息和引用来源的答案?谢谢
标签: php string web-applications types comparison