[SWPUCTF 2021 新生赛]jicao--json_decode()函数

源码

<?php
highlight_file('index.php');
include("flag.php");
$id=$_POST['id'];
$json=json_decode($_GET['json'],true);
if ($id=="wllmNB"&&$json['x']=="wllm")
{echo $flag;}
?>

关键是其中的

$json=json_decode($_GET['json'],true);

解释:PHP json_decode()函数详解-CSDN博客

意思就是将字符串转为数组,json_decode()之后,$json 相当于一个键值对,则只要输入的json={"x":"wllm"}

 

posted @ 2024-02-03 16:36  努力的大魔王  阅读(73)  评论(0)    收藏  举报