|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello i am using the following code to display a message if a variable is not equal to 1 or 2 if this is not equal it displays an error but if it is equal it does nothing. The code below shows the error never mind what the value is this isn't what i want.
Code:
$display = 1;
if ($display !== 1 || 2)
{
echo "error";
}
|
|
|||
|
Try this
<code> $display_test = 1; switch ($display_test) { case 1: echo 'no error'; break; case 2: echo 'no error'; break; default: echo 'error'; break; } </code> |
|
|||
|
Or try this:
Code:
$display = 1;
if ( $display != 1 && $display != 2 )
{
echo "error";
}
|
|
|||
|
Quote:
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hope This Helps | ctabuk | Search Engine Optimization Forum | 0 | 10-30-2004 10:58 AM |
| Hope this comes through | Belltoons | Member Photos | 2 | 05-10-2004 12:17 PM |
| Have a little Hope | wenwilder | The Castle Breakroom (General: Any Topic) | 2 | 03-03-2004 07:48 PM |
| here's my pic I hope I did it right;) | Ne0 | Member Photos | 4 | 02-06-2004 08:54 PM |
| New and I can help you (I hope) | Work Ally | Introductions | 1 | 01-05-2004 10:37 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |