Join Kevin Skoglund for an in-depth discussion in this video Add support for knots, part of Easy PHP Projects: Measurement Conversion.
- In the last movie, we added support…for a number of different speed types,…and we're now able to convert between them.…In this movie, I want us to add support for knots.…Knots is a maritime speed of measurement.…We would use it if we were on a boat…and to describe how fast the boat was going.…This might be a little bit of an esoteric measurement…that doesn't really come into common use…and most of us probably don't care.…However, I think it does present us…with an interesting PHP exercise.…We've come to depend on having the format…distance, per, and then time.…
That's how we define our speed…is with those three words.…And we're even looking for per…in order to split up and locate…the distance and the time…which our calculation depends on.…But knots doesn't follow this pattern.…Let's go over to speed.php…and right after kilometers per hour,…let's add a new one that is knots.…Alright, see how it breaks the pattern?…It's a little bit different.…So how do we handle that?…Let's put on our thinking caps.…Let's save this file.…
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
PHP: Accessing Databases with PDO and MySQLiwith 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?
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.