Jump to content

[SOLVED] Help with syntax


coop

Recommended Posts

Hi all,

 

I'm more use to ActionScript, so I'm getting a little confused with php syntax. What does the "->" mean is this same as the dot syntax in ActionScript where you would write "this.paypal_post_vars = $paypal_post_vars"

 

function paypal_ipn($paypal_post_vars)}
   $this->paypal_post_vars = $paypal_post_vars;
   $this->timeout = 120;
}

Link to comment
https://forums.phpfreaks.com/topic/36614-solved-help-with-syntax/
Share on other sites

when using the -> it is refering to a CLASS. that function would be part of a class. so when calling $this->paypal_post_vars you are setting the variable paypal_post_vars in your class to $paypal_post_vars.

 

it would look like this:

 

class Paypal { //just a made up name

public $paypal_post_vars = "";
public $timeout = "";

function paypal_ipn($paypal_post_vars){
   $this->paypal_post_vars = $paypal_post_vars;
   $this->timeout = 120;
}

}

 

and i just noticed an error, on the function like you have a }. it should be the other direction {

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.