PHP Switch Statement - Switch vs if/else statement - Full PHP 8 Tutorial

Veröffentlicht am: 02 Januar 2021
auf dem Kanal: Program With Gio
46,062
1.6k

In this PHP tutorial you will learn about the switch statement in PHP, how to use it with examples, concerns when using switch statement within loops & the differences between the series of if statements & the switch statement. The switch statement is similar to if, elseif, else statements. The main difference is that the switch statement takes a single expression & compares its value against multiple values (cases).

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments on videos, any feedback is greatly appreciated
⭐ Become a Patreon:   / programwithgio  
THANK YOU!

LESSON 1.17
Course Outline - https://github.com/ggelashvili/learnp...
Course Playlist -    • Learn PHP The Right Way - Full PHP Tutoria...  

RESOURCES
Check https://www.php.net/manual/en/control... for alternative syntax for the switch statement.

CHAPTERS
00:00 - Switch statement
00:50 - Default case
01:00 - Break statement within switch & how does switch statement work
02:39 - Fall-through strategy & use-case of omitting the break statement
03:28 - Loose comparison
04:10 - Switch statement within loops & using break
04:57 - Using continue statement within the switch statement that's within loop
05:42 - Difference between switch statement & series of if statements (switch vs if). Demonstrating example of the performance difference


Auf dieser Seite können Sie das Online-Video PHP Switch Statement - Switch vs if/else statement - Full PHP 8 Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Program With Gio 02 Januar 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 46,062 Mal angesehen und es wurde von 1.6 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!