Parse error: syntax error, unexpected T_OBJECT_OPERATOR in line 89
I am just in the process of learning OOP PHP 5.
The error is in the foreach. I am probably doing something wrong with the start. It works when I write is procedurally. I'm sure this is a
syntax issue
Related issue is when should I use $this->variable and just $variable in a method.
public function sendTransaction()
{
//below is line 89
foreach(this->$authnet_values as $key => $value )
$this->fields .= "$key=" . urlencode( $value ) . "&";
$this->ch = curl_init($this->auth_net_url);
curl_setopt($this->ch, CURLOPT_HEADER, 0); /
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, rtrim( $this->fields, "& " ));
### curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$this->resp = curl_exec($this->ch); //execute post and get results
curl_close ($this->ch);
}