HTML5 and CSS3 All-in-One For Dummies
Book image
Explore Book Buy On Amazon

Often, you run across a situation in HTML5 and CSS3 programming where you have one expression that can have many possible values. You can always use the structure to manage this situation, but PHP supplies another interesting option.

image0.jpg

The code for this program uses the switch structure. Take a look at how it’s done:



 
 switch.php


Ask the magic 8 ball a yes or no question!

fat chance

";

About This Article

This article is from the book:

About the book author:

Andy Harris taught himself programming because it was fun. Today he teaches computer science, game development, and web programming at the university level; is a technology consultant for the state of Indiana; has helped people with disabilities to form their own web development companies; and works with families who wish to teach computing at home.

This article can be found in the category: