I was looking at some source code, specifically for Paypal IPN, and I noticed the author sets two variables in this format: $config[‘business’] and $config[‘different_text’]
Is there a special reason other than the obvious organization for declaring my variables this way or is this Paypal settings?
This syntax is used to access elements of an array — see Arrays in the PHP manual.
Here, you are working with an associative array, called
$config, that’s contain at least two entries :businessanddifferent_text.Considering the name of the
$configvariable, you have at least two advantages :$config) to work withAnd, of course :
$configarray.That being said, of course, maybe the paypal API you are using is actually expecting some data passed as an associative array containing those elements — if it is the case, you don’t have much of a choice.