bumba000 Posted May 12, 2008 Share Posted May 12, 2008 Hi Thanks for reading, I was recently here with a problem and got it worked out. Well, got it worked around. I'm trying to figure out what caused the problem but I've been looking over the same code for HOURS and still don't feel any closer to an answer. For starters if you could please explain what "totals" is doing in the code below. By this I mean, what is it's job, in what way does it relate to $orders? <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> The page that this exists on does include several other pages. The most relevant to this problem would likely be order.php. order.php Thanks in advance, John Link to comment https://forums.phpfreaks.com/topic/105206-please-help-me-understand/ Share on other sites More sharing options...
bilis_money Posted May 12, 2008 Share Posted May 12, 2008 the value of $orders is also the value of total. accessing the value of total. Accessing methods/properties of a class. Link to comment https://forums.phpfreaks.com/topic/105206-please-help-me-understand/#findComment-538725 Share on other sites More sharing options...
bumba000 Posted May 12, 2008 Author Share Posted May 12, 2008 Thank you but I'm not sure I understand. John Link to comment https://forums.phpfreaks.com/topic/105206-please-help-me-understand/#findComment-538745 Share on other sites More sharing options...
bilis_money Posted May 12, 2008 Share Posted May 12, 2008 ok, since you are a beginner please study OOP or CLASS please read the link below. http://www.killerphp.com/tutorials/object-oriented-php/ it's a tutorial for newbie like you, don't worry it's easy to understand. GOOD LUCK. Link to comment https://forums.phpfreaks.com/topic/105206-please-help-me-understand/#findComment-538772 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.