当我提供像“kaushik”这样的输入时,我试图从用户那里获取输入,但json输出没有出现
这是我的代码
<?php
if(!empty($_POST['name'])){
$name = strip_tags(@$_POST['name']);
//echo $name;
$json = '{
"a":"'.$name.'",
"b":"Kishore",
"c":"ramesh",
"d":"Suresh",
"e":"ramu"
}';
$jsonOutput = json_decode($json,true);
print_r($jsonOutput);
}
?>
<form name = "myform" action = "" method = "POST">
Name <input type = "name" name = "name"/></br>
<input type= "Submit" name = "submit" value = "show"/>
</form>