Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Learn to build a basic calculator using Object-Oriented PHP in this 24-minute tutorial. Explore fundamental OOP concepts including classes, properties, methods, and error handling. Follow along as the instructor guides you through creating a calculator class, implementing calculation methods, and utilizing a switch statement for different operations. Practice passing properties, creating objects, and executing calculations within a try-catch block. Gain hands-on experience with file organization, HTML form integration, and practical application of OOP principles in PHP development.
Syllabus
Intro
New office
Index page
HTML form
Classes file
Inside a website
Checking for errors
Explaining calcinc
Creating the class
Creating the methods
Creating the properties
Assigning the properties
Passing in properties
Creating the second object
Creating the calculator method
Creating the switch
Changing the path
Creating spacing
Creating upper operator
Running the calculation
Running the trycatch block
Running the calculate method
Taught by
Dani Krossing