Reply to Re: [PHP] professional code quick tip

Your name:

Reply:


Posted by "Thorsten Suckow-Homberg" on 09/21/05 02:47

>> in other languages it is possible use conditional epression in switch
>> case
>> like
>> switch $n
>>
>> case (0<n<=4):
>> ........
>>
>> but no in php

You could use the following statement:

<?php
switch (true) {
case (0 < $n <= 4):
$f = 1;
break;
case (5 < $n <= 7):
$f = 2;
break;
case (8 < $n <= 12):
$f = 3;
break;
default:
$f = 4;
break;
}
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация