Search results for 'PHP Switch'. 2 post(s) found.
- 2007/10/16 Can PHP switch in strings ?
- 2007/10/16 PHP Switch Example
The answer is YES. Here's the example.
<?php
// switch example using strings
$creature="dragon";
switch ($creature){
case "rat":
echo "a $creature goes: eek eek eek";
break;
case "dragon":
echo "a $creature goes: nice to eat you";
break;
case "pig":
echo "a $creature goes: oink oink oink";
break;
default:
echo "I have not heard of this creature";
break;
}
?>
// switch example using strings
$creature="dragon";
switch ($creature){
case "rat":
echo "a $creature goes: eek eek eek";
break;
case "dragon":
echo "a $creature goes: nice to eat you";
break;
case "pig":
echo "a $creature goes: oink oink oink";
break;
default:
echo "I have not heard of this creature";
break;
}
?>
Another posts included in "PHP"
| foreach loop (0) | 2007/10/16 |
| Posting to a Wordpress Blog Via XMLRPC Using Blogger API (1) | 2007/12/15 |
| How to post blog content by metaweblog API ? (3) | 2008/01/02 |
| PHP Switch Example (0) | 2007/10/16 |
| How to send email in PHP ? (0) | 2007/10/16 |
| How to pass variables via url (0) | 2007/10/16 |
| How to declare array in PHP like C/C++ (0) | 2007/10/16 |
| PHP date and time formatting (0) | 2007/10/16 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 02:57
moneyideas
-
Subject different money making ideas
2010/01/29 11:53
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas
Here's PHP Switch example
<?
// switch example using integers
$option=4;
switch ($option) {
case 1:
echo "a good monkey sees no evil";
break;
case 2:
echo "a good monkey speaks no evil";
break;
case 3:
echo "a good monkey hears no evil";
break;
case 4:
echo "a good monkey does no evil";
break;
}
?>
// switch example using integers
$option=4;
switch ($option) {
case 1:
echo "a good monkey sees no evil";
break;
case 2:
echo "a good monkey speaks no evil";
break;
case 3:
echo "a good monkey hears no evil";
break;
case 4:
echo "a good monkey does no evil";
break;
}
?>
Another posts included in "PHP"
| Can PHP switch in strings ? (0) | 2007/10/16 |
| foreach loop (0) | 2007/10/16 |
| Posting to a Wordpress Blog Via XMLRPC Using Blogger API (1) | 2007/12/15 |
| How to send email in PHP ? (0) | 2007/10/16 |
| How to pass variables via url (0) | 2007/10/16 |
| How to declare array in PHP like C/C++ (0) | 2007/10/16 |
| PHP date and time formatting (0) | 2007/10/16 |
| How to redirect browser in PHP ? (0) | 2007/10/16 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 04:50
moneyideas
-
Subject different money making ideas
2010/01/29 13:31
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas

Prev

Rss Feed