Jump to content

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 {

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.