Jump to content
Larry Ullman's Book Forums

Alpha

Members
  • Posts

    2
  • Joined

  • Last visited

Alpha's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yes, I believe I get it now. I see now how calculate_trip_cost on line 48 maps distance, efficiency and gallon_price to $miles, $mpg and $ppg, respectively. The break down was very much appreciated, thanks!
  2. Hi there. Completely new to php, working my way through the book. Whilst I got this script to work (Script 3.10), I don't quite understand why it works/worked. In the calculate_trip_cost function, I don't understand how it gets values for the $miles, $mpg and $ppg arguments. They are only defined within the function (which I think might have something to do with Variable Scope, mentioned a couple of pages later), and don't appear to be getting data from the form. If somebody could take the time to explain this to me, I'd be hugely appreciative. Thanks in advance!
×
×
  • Create New...