<aside> 💡 Notion Tip: PHP.
</aside>
extract()
<?php
$a = "Original";
$my_array = array("a" => "Cat", "b" => "Dog", "c" => "Horse");
extract($my_array, EXTR_PREFIX_SAME, "dup");
echo "\\$a = $a; \\$b = $b; \\$c = $c; \\$dup_a = $dup_a";
?>
$$
<!--foreach($_GET as $key => $value){
$$key = $value;
}
if($name == "meizijiu233"){
echo $flag;
}-->
<?php
var_dump("admin"==0); //true
var_dump("1admin"==1); //true
var_dump("admin1"==1) //false
var_dump("admin1"==0) //true
var_dump("0e123456"=="0e4456789"); //true
?>
上述代码,第一个把字符串强制转化为0,第二个会默认取字符串的首值,强转为1,第三个和第二个相反,取到的首值为字符串,直接强转为0,最后一个被转化为了科学计数,0的N次方,是0
"Hello" < "hello"
H=72,h=104
0e215962017
define('Flag', 'azhen{THIS_IS_FLAG}');
if ($_GET['s1'] != $_GET['s2'] && md5($_GET['s1']) == md5($_GET['s2'])) {
echo "Success, flag:" . FLAG;
} else {
echo "ERROR";
}
0e 纯数字这种格式的字符串在判断相等的时候会被认为是科学计数法的数字,先做字符串到数字的转换
1 != 2,md5([1]) == md5([2])
localhost:80/index.php/?s1[]=1&s2[]=2