今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Creating if/else statements
- [Instructor] Control structures are used in PHP to employ logic to our code and make things happen based on a set of criteria. All of the decision-making in a program happens because of control structures. This is also where we'll use boolean statements most often. The most common control structure is if statements. An if statement will check for a condition to be true, and if it's true it will execute a specific set of code. Here's an example. If the variable A is greater than the variable B, then we want to echo the statement A is greater than B. Notice I'm using single quotes here, so I want the actual variable to be printed and not the value the variable is representing. This is a complete statement. There is no other code required, and what it says in plain English is if the condition A is greater than B is true, execute the following code. However, there is more code that we can add to it. First, we can add an…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
Comparison operators and the truth4 分钟 26 秒
-
(已锁定)
Logical operators5 分钟 55 秒
-
(已锁定)
Creating if/else statements6 分钟 53 秒
-
(已锁定)
Conditional tags in WordPress1 分钟 19 秒
-
(已锁定)
Loops7 分钟 56 秒
-
(已锁定)
The Loop in WordPress2 分钟 54 秒
-
(已锁定)
Challenge: Loop through an array of information1 分钟 18 秒
-
(已锁定)
Solution: Loop through an array of information5 分钟 28 秒
-
-
-
-