Question
Syntax for switch statement to handle multiple if's on one variable value
Answer
switch ( $num) { case 1 : statement-to-execute; break; case2 : statement-to-execute; break; case 3 : statement-to-execute; break; default: statement-to-execute; break; }

Comments:

Other flashcards from PHP :
Special markup tags to tell Apache th...       Command to dynamically write content ...       Syntax for ending PHP code line       Syntax for marking comments       How do you designate a variable name       Syntax for concatenation of strings       Syntax for logical AND, OR,and NOT op...       Comparison operator to determine if 2...       Conditional operator. First evaluates...       Syntax for accessing global variable ...       Syntax for if and if-else logic       Syntax for switch statement to handle...       Syntax for for loop with specific num...       Syntax for while and do-while loops       Keyword for terminating a loop early       Keyword for stopping current iteratio...       Keyword for returning value from func...       Syntax for creating and populating ar...       Syntax for looping through array elem...       Functionfor getting the array size       4 functions for adding and removing a...       Syntax for using key-values in arrays       Function to merge 2 arrays       Function to select a range of an arra...       Function to retrieve environment vari...       Function that seeks a match a specifi...       Function to seed a random number / ge...       How do you access variables submitted...       What variable allows you to post back...       Function call to tell page not to use...       How to you tell the browser to redire...       How do you open a directory, loop thr...       Copy a file to any location       Deletea file       Functions to open, get file length,re...       Function to write or append to a file       Function to test for existence of file       How do you access a file upload       Function to terminate script and disp...       How do you create cookies       How do you reference a cookie       Function to start a PHP session       Function to find out if a particular ...       How do you access a session variable       How do you get sessions to auto start       How do you enable PHP mail       Send plain text email       Function to take as input a message o...       Connect to MySQL       Return a "result set" of information ...       Discover how many rows are in a resul...       Return a result set of information ab...       Executing a SQL statement       Select a database to work with       Fetch a row of data from a MySQLquery       Create a new DOM Documentobject       Method to load an XML file       Method to access the root element of ...       Access a specific nested element of a...       Function of SimpleXMLextension       Superglobal variable that contains in...       How do you create a class that inheri...       Function to sort elements of array       Function: Checks the validity of the ...       Superglobals that contains any global...       Superglobal variable that contains in...       Superglobal variable that contains in...       What is the difference between using ...       Function to compare 2 strings includi...       Function to compare 2 strings without...       How can define constants in your prog...       Predefined constant which returns the...       Predefined constant which returns the...       Are variables case sensitive in PHP       How do you explicitly convert a varia...       How do you do bitwise shifting       How do you do a ternary operator whic...       function that prints readable informa...       Function that calculates the md5 hash...       Function to make a string uppercase /...       How would you access the first charac...       Function to Uppercase the first chara...       Function to Make a string's first cha...       Function thatchecks the list of defin...       How can you define a class       How do you access a member function o...       2 methods for creating a class contru...       How do you create a new instance of a...       How do you call parent class code in ...       How do you declare class methods and ...       How do you refer to a class method if...       How can you get a reference to a vari...       Outcome of the statement: $weekdays[]...       Function that allows you to create yo...       Function to test whether a variable i...       Syntax for Arrays referenced in a str...       Syntax for looping through an associa...       Syntax for creating multi-dimensional...       Syntax for using each and list to tra...       Function that Return the current key ...       Function: Set the internal pointer of...       Purpose of statement: list($drink, $c...       A shortcut for placing elements in an...       When using expand One way to prevent ...       Function that is the complement of ex...       Function that Adds one or more elemen...       Function Returns and removes the last...       Function that Adds one or more elemen...       Function that Returns and removes the...       Function that Combines two arrays tog...       Function that Returns an array contai...       Function that Returns an array contai...       Function to spit out all the configur...       Function that Resorts the array in ra...       How do you know that mysql_connect ca...       Function to get the rows from the res...       What is the difference between mysql_...       How can you find out which PEAR modul...       How do you find what your document ro...       Function: Returns TRUE if the filenam...       What is the function of php.ini file ...       Function to parse about any English t...       How do you create a function with opt...       How do make a parameter call by refer...       How do you access a global variable w...       How do you define a variable within a...       Function: Gets line from file pointer       Function: Tests for end-of-file on a ...       Function: Sets the file position indi...       Function: Gets character from file po...       Function: Portable advisory file lock...       Function: Makes directory       Function: Removes directory       Function: Tells whether the filename ...       Function: Tells whether the filename ...       Function: Returns TRUE if the file or...       Function: Tells whether the filename ...       Function: Returns the time the file w...       Function: Returns the time the file w...       Function: Returns the time the file w...       Method for accessing information GET ...       Set up a loop to go through every val...       How do you auto-register globals - ma...       How do you control the maximum file u...       Function: Delay execution in microsec...       php.ini file configuration option:the...       php.ini file configuration option:con...       php.ini file configuration option:the...       php.ini file configuration option:con...       php.ini file configuration option: th...       How do you register variables with th...       Function to destroy a session and fre...       How do you save and retrieve a user's...       Function: Sets which PHP errors are r...       Function: Send an error message somew...       Function: Sets a user-defined error h...       Function: Restores the previous error...       Function Generates a user-level error...       Function: Generates a backtrace       Function: Prints a backtrace       Function: Get the last occurred error       Function: Sets the default exception ...       Function: Restores the previously def...       Function: displays structured informa...       Function: Returns the text of the err...       Function: Close MySQL connection       Function: manually control which row ...       Function: Returns a string with backs...       Function: Get the number of affected ...       Function: frees the memory and data a...       Function: Change logged in user of th...       Functions: to create / drop a MySql d...       Function: Returns the numerical value...       Function: Get column information from...       Function: Fetch a result row as an ob...       Function: Open a persistent connectio...       Function: Ping a MySQLserver connecti...       Function: Get current system statusof...       Define: PFC       Define: PECL       Function: Format a local time/date       Function: Get date/time information       Proper way to declare a global variable       Function: Split a string into pieces       Function: Determine whether a variabl...       What is the difference between print ...       Delimitter to mark out beginning and ...       2 built in functions for outputting d...       How are double quotes treated differe...       How can you get print statement to us...       Function to return the type of a vari...       Function to test whether a variable i...       Function to test if variable is a flo...       Function to test if variable is a boo...       Function to test if variable is a cha...       Function that converts variable types       Comparison operator that tests if 2 v...      
What's new | About Us | Privacy Policy | Copyright Policy | Contact Us

Copyright 2007-2008 YoYoBrain.com