Questions about array Assignment

Source: Internet
Author: User
Problem with array assignment

Public Function Setparm ($parameter, $value) {
$this->parameter[$parameter] = $value;
return $this;
}

function Geturl ($type) {
$this->setproductparm ($type);
return $this->getdata ();
}

Private Function Setproductparm ($urltype) {
$this->parameter=array ();
$this->type= "";
$this->setparm ("Marketplace", Self::marketplaceid);
$this->version= "2009-01-01";
Switch ($urltype) {
Case "Requestreport":
$this->setparm ("Action", "Requestreport");
$this->setparm ("Reporttype", "_get_merchant_listings_data_");
Break
Case "Getreportlist":
$this->setparm ("Action", "getreportlist");
$this->setparm ("Reportrequestidlist.id.1", $this->reportrequestid);
Break
Case "GetReport":
$this->setparm ("Action", "GetReport");
$this->setparm ("ReportID", $this->reportid);
Break


}

}

$url 1= $aa->geturl ("Requestreport");
$url 2= $aa->geturl ("getreportlist");
$url 3= $aa->geturl ("GetReport");

I clear the array before every execution.
$this->parameter=array ();
But the output, each time the array contains the last assigned value.
Each result:
$url 1:reporttype=_get_merchant_listings_data_
$url 2:reporttype=_get_merchant_listings_data_&reportrequestidlist.id.1=123456
$url 3:reporttype=_get_merchant_listings_data_&reportrequestidlist.id.1=123456&reportid=123456

Excuse me, where is the problem???
------to solve the idea----------------------
You don't give a definition of getData, you're not.
------to solve the idea----------------------

See if the following is the way to deal with it.
GetData ();
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.