当前位置:Gxlcms > PHP教程 > 数组赋值的有关问题

数组赋值的有关问题

时间:2021-07-01 10:21:17 帮助过:19人阅读

数组赋值的问题
  1. <br>public function setParm($parameter, $value) {<br>
  2. $this->parameter[$parameter] = $value;<br>
  3. return $this;<br>
  4. }<br><br>function geturl($type){<br> $this->setproductparm($type);<br> return $this->getData();<br> } <br> <br>private function setproductparm($urltype){<br> $this->parameter=array();<br> $this->type="";<br> $this->setParm("Marketplace",self::marketplaceId);<br> $this->version="2009-01-01";<br> switch ($urltype){<br> case "RequestReport": <br> $this->setParm("Action","RequestReport");<br> $this->setParm("ReportType","_GET_MERCHANT_LISTINGS_DATA_");<br> break;<br> case "GetReportList": <br> $this->setParm("Action","GetReportList"); <br> $this->setParm("ReportRequestIdList.Id.1",$this->ReportRequestId);<br> break;<br> case "GetReport": <br> $this->setParm("Action","GetReport"); <br> $this->setParm("ReportId",$this->ReportId); <br> break; <br> <br> <br> }<br> <br> }<br>

$url1=$aa->geturl("RequestReport");
$url2=$aa->geturl("GetReportList");
$url3=$aa->geturl("GetReport");

我明明每次执行前都清除了数组
$this->parameter=array();
但输出时,每次数组都包含了上次所赋的值。
每次结果:
$url1:ReportType=_GET_MERCHANT_LISTINGS_DATA_
$url2:ReportType=_GET_MERCHANT_LISTINGS_DATA_&ReportRequestIdList.Id.1=123456
$url3:ReportType=_GET_MERCHANT_LISTINGS_DATA_&ReportRequestIdList.Id.1=123456&ReportId=123456

请问是哪里的问题啊???
------解决思路----------------------
你没有给出 getData 的定义,不好说
------解决思路----------------------
  1. <br>//看看是不是下面的方法哪里处理了<br>getData();<br>

人气教程排行