From the course: PHP for WordPress
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Perform a mathematic operation and store it - PHP Tutorial
From the course: PHP for WordPress
Challenge: Perform a mathematic operation and store it
(upbeat music) - [Instructor] To make sure you grasp the basics of PHP in this challenge you will perform a set of mathematical operations and store the results into variables. Store each result from the following equations in an array called results, then at the end print out those results. This is where your No WordPress installation on local will come in handy. In your favorite text editor, in this video I'm using Visual Studio Code, you can go to File, Open, and then find your workspace. So this will be under Local Sites, no-wordpress, app, public, and then you can open the entire public folder. Then you would create a new file in that folder. We can call it solution.php. And here is where you would write the solution. Then in local you would visit the site domain, which for me is no-wordpress.local/solution.php.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is PHP?2m 1s
-
(Locked)
Printing information3m 15s
-
(Locked)
What are variables?6m
-
(Locked)
Strings in PHP5m 57s
-
(Locked)
Using arrays7m 59s
-
(Locked)
Arithmetic operators and math in PHP4m 38s
-
(Locked)
Challenge: Perform a mathematic operation and store it1m 14s
-
(Locked)
Solution: Perform a mathematic operation and store it3m 33s
-
-
-
-
-