![]() Operating on $destination in immediately did a search for a case with the The value of $destination was Tokyo, so when PHP performed the switch In our example the single variable will be $destinationĪnd the cases will be: Las Vegas, Amsterdam, Egypt, Tokyo, and the Caribbean Islands. Instead of having to check that variable one at a time,Īs it goes through a bunch of If Statements, the Switch statement only has to check The way the Switch statement works is it takes a single variable as inputĪnd then checks it against all the different cases you set up for that With the use of the switch statement you can check for all theseĬonditions at once, and the great thing is that it is actually more efficient Let's see if we can do something different. This doesn't sound like much fun to code, In this example you might haveĢ0 different locations that you would have to check with a nasty long block To pack according to this destination variable. PHP Tutorial PHP - Introduction PHP - Installation PHP - Syntax PHP - Variables PHP - Echo PHP - Strings PHP - Operators PHP - Comments PHP - Include File PHP - Require PHP - If Statement PHP - If.Else PHP - Elseif PHP - Switch PHP - Forms PHP - Functions PHP - Array PHP - While Loop PHP - For Loop PHP - For Each PHP - Do While PHP - POST & GET PHP - Magic Quotes PHP - htmlentities PHP Files PHP - File PHP - File Create PHP - File Open PHP - File Close PHP - File Write PHP - File Read PHP - File Delete PHP - File Append PHP - File Truncate PHP - File Upload PHP Strings PHP - strpos PHP - str_replace PHP - substr_replace PHP - Capitalization PHP - explode PHP - implode PHP Advanced PHP - Date PHP - Session PHP - Cookiesįor example we might have a variable that stores travel destinations and you want Miscellaneous XML Tutorial Webhost Tutorial Flash Tutorial SEO Tutorial Scripting Javascript Tutorial PHP Tutorial Perl Tutorial Ajax Tutorial ASP Tutorial VBScript Tutorial ![]() Web Tutorials Beginner Tutorial HTML Tutorial CSS Tutorial ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |