Join Kevin Skoglund for an in-depth discussion in this video Switch statements, part of PHP Essential Training.
- [Instructor] In this movie we're going to be looking…at a different kind of logical expression…called switch statements.…Switch statements are similar to if statements…in that they control the flow through our application…but they're going to have a different syntax,…some different rules to follow,…and a couple of special gotchas that we want to make sure…that we watch out for.…First let's look at the basic syntax.…We're going to use the function name switch…followed by an argument,…and that argument's going to be a value.…This is the vale that we're going to be testing…through each of a series of test cases.…So then in our curly braces we're going to list off…those test cases,…and each one is going to start with case…and then a test value that we're going to test against value…to see if they're equal,…and then a colon and then a statement…or series of statements that we want to execute.…
Then following that will be the next case…that we want to test.…So we'll test whether the value is equal to test value two…
- What is PHP?
- Embedding PHP code on a page
- Inserting code comments
- Variables, strings, arrays, and Booleans
- If, else, and elseif statements
- While and for loops
- User-defined functions
- Function arguments and return values
- Debugging and troubleshooting
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. PHP Overview
2. First Steps
3. Explore Data Types
4. Control Structures: Logical Expressions
5. Control Structures: Loops
6. User-Defined Functions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.