Page 1 of 1

PLease clarify statement

Posted: Sat Feb 14, 2004 8:13 am
by rfigley
I'm working with OScommerce a lot and There are a lot of statements like this:

<?php echo $order->info['payment_method']; ?>

Can someone clarify what this is doing, I believe it is accessing the data from the 'payment_method' field in the "order" table of the database?

If so, not sure how to interpret a similar statement.

<?php echo $order->customer['telephone']; ?>

Thanks for any assistance.

Posted: Sat Feb 14, 2004 10:52 am
by patrikG
This has nothing to do with accessing data in a database:

$order is an object:

$order->

and customer is a property of that object:

$order->customer

Customer happens to be an associative array, hence you have

$order->customer['payment_method']

If in doubt or question use the great manual to read up on objects and associative arrays.