Improve your PHP skills with these easy projects. Learn how to build a calculator in PHP to convert measurements (length, area, speed, temperature, etc.) between different units.
- View Offline
- [Voiceover] Welcome to Easy PHP Projects: Measurement Conversion. My name is Kevin Skoglund. This course is part of the Easy PHP Projects series. These courses are designed to present projects that require only basic PHP knowledge. The projects in this course are ideal for beginners who are just starting out. They prove that one does not have to write months of code to have a working website. For more experienced developers, they can serve as good mental exercises. I will demonstrate some techniques and best practices that can help you to build your skills.
In this course, we will use PHP to perform conversions between different types of measurements. We will learn about many different types of measurement units. We will develop strategies for making our unit conversions, write the code, and then learn how to improve that code through smart refactoring. We will dynamically generate a list of options for a form select in order to reduce the code we have to write and to maintain. We will discover the pitfalls of scientific notation and then see how to better format floating point numbers.
Let's get started creating some easy PHP projects.
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