PHP从Android studio截取请求接收JSON对象

PHP从Android studio截取请求接收JSON对象,php,json,android-volley,jsondecoder,Php,Json,Android Volley,Jsondecoder,我正在使用Android studio使用截击发送GET请求。我包括一个名为whererray的HashMAP参数。我的截击请求中的URL请求如下所示 https://xxxxxxxx.co.za/api/select_from_fact_sighting.php?whereArray={国家名称=博茨瓦纳,地区=南部非洲} 我需要在服务器端使用此参数的帮助—在服务器端我希望循环使用它并将其内爆为SQLWHERE子句。但我正在努力解码php脚本中的数组,我假设它应该转换为Json对象?。我已经包

我正在使用Android studio使用截击发送GET请求。我包括一个名为whererray的HashMAP参数。我的截击请求中的URL请求如下所示

https://xxxxxxxx.co.za/api/select_from_fact_sighting.php?whereArray={国家名称=博茨瓦纳,地区=南部非洲}

我需要在服务器端使用此参数的帮助—在服务器端我希望循环使用它并将其内爆为SQLWHERE子句。但我正在努力解码php脚本中的数组,我假设它应该转换为Json对象?。我已经包含了一个php函数的片段,我试图在其中解码数组

public function select_from_fact_sighting($whereArray) {

    $jsonArray = json_decode($whereArray);
    $elementCount  = count($jsonArray); ```
美元whereArray中的值为{country_name=Botswana,region=Southern Africa} 但是$jsonArray中的值为空,$elementCount为0,这意味着json解码数组中没有任何内容。在PHP中解码参数和在结果数组中循环的任何帮助都将不胜感激

谢谢

{country\u name=Botswana,region=Southern Africa}不是有效的JSON,它应该是{country\u name:Botswana,region:Southern Africa}

另外,json_decode根据默认值返回一个对象,而不是一个数组,如果需要数组,则需要将true作为第二个参数传递:json_decode$whererray,true


请参阅文档:

是否不推荐使用截击?