PHP上的多个isset

问题描述 投票:-1回答:1

例如,如何通过添加ID和权重,或仅通过使用JSON添加ID来获得ISSET搜索?

例如example.php?tag = id = 3343&weight = alot

<?php 

header('Content-Type: application/json');

$tags= array();

$data = (object) [];
$data->id= "3343";
$data->weight= "alot";
$data->year= 42;
array_push( $data);

if( isset( $_GET['tag'])){
    echo json_encode($tags);
}
?>
php json get isset
1个回答
0
投票

isset的功能可以采用多个参数,您可以像这样进行更改:

if( isset( $_GET['tag'],$_GET['weight'], ... ))
{
echo json_encode($tags);
}

我希望这就是您想要的。

© www.soinside.com 2019 - 2024. All rights reserved.