Hi I have problem understanding the code below:
foreach ($_POST as $field=>$value) {
$this->ipn_data["$field"] = $value;
$post_string .= $field.'='.urlencode(stripslashes($value)).'&';
}
What does $this->ipn_data["$field"] = $value do? I need some examples to understand this.
The following line:
needs to be understood in context. The $this keyword refers to the current object in which the code is executed.
For example, consider this:
In your case, the $this->ipn_data is a member of the class, and is an array. The $field is being set as the key in the array and the $value is assigned to that new key in the ipn_data array.