note 103709 added to control-structures.elseif
| From: | rakeshnsony at gmail dot com | Date: | Fri, 29 Apr 2011 11:38:13 +0000 |
| Subject: | note 103709 added to control-structures.elseif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179259@lists.php.net to get a copy of this message | ||
<?php
/*
* Date: 29 April 2011
* Rakesh Verma
* Financial year quarter calculation using if else condition
*/
// Calculation for financial year quarter(s)
$qtr1=array(04,05,06);
$qtr2=array(07,08,09);
$qtr3=array(10,11,12);
$qtr4=array(01,02,03);
$c_month=date('m');
// if else condition for checking Quarter
if(in_array($c_month,$qtr1)) {
echo "Quarter I";
} else if(in_array($c_month,$qtr2)) {
echo "Quarter II";
} else if(in_array($c_month,$qtr3)) {
echo "Quarter III";
} else if(in_array($c_month,$qtr4)) {
echo "Quarter IV";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 122.176.88.108
----
Manual Page -- http://www.php.net/manual/en/control-structures.elseif.php
Edit -- https://master.php.net/note/edit/103709
Del: integrated -- https://master.php.net/note/delete/103709/integrated
Del: useless -- https://master.php.net/note/delete/103709/useless
Del: bad code -- https://master.php.net/note/delete/103709/bad+code
Del: spam -- https://master.php.net/note/delete/103709/spam
Del: non-english -- https://master.php.net/note/delete/103709/non-english
Del: in docs -- https://master.php.net/note/delete/103709/in+docs
Del: other reasons-- https://master.php.net/note/delete/103709
Reject -- https://master.php.net/note/reject/103709
Search -- https://master.php.net/manage/user-notes.php