Join Kevin Skoglund for an in-depth discussion in this video Convert to and from metric temperature, part of Easy PHP Projects: Measurement Conversion.
In this movie, we will write the code…to convert between Celsius, Fahrenheit,…and Kelvin temperatures.…The first we'll do, is we'll take our recent…speed.php file and we'll duplicate that…in order to get our temperature file,…temperature.php .…Then we will open that up in a text editor.…You can see it shows up here inside my project in TextMate…and I've already got a link to it on my index.php page.…So I'll have a big button, I click, and it will…take me to the form for temperature.…
Let's open that up, temperature.php.…Now, right now this has the speed code in it,…so we need to modify that.…So, instead of convert speed,…it will be convert temperature.…The speed options, we're going to change to…temp options, so just a little shorter…than calling it temperature and we want to write those out.…The first one we've got is Celsius,…and then there's Fahrenheit,…and Kelvin.…Those are our three options.…
Let's come down here and change…the name of this to be temperature,…this one to be temperature, and just change this…from being speed options to temp options,…
Along the way, series designer Kevin Skoglund introduces coding strategies, refactoring techniques, and useful skills including dynamically generating form select-option values and formatting decimal numbers and scientific notation.
- Converting length and area measurements
- Using functions to avoid repetition
- Refactoring to produce simpler code
- Converting volume and mass
- Generating form select-option values dynamically
- Formatting scientific notation
- Converting speed and temperature
Skill Level Beginner
Accessing Databases with Object-Oriented PHPwith David Powers3h 47m Intermediate
1. Length and Distance
3. Volume and Capacity
4. Mass and Weight
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.