Last active
December 14, 2015 18:39
-
-
Save sohelrana820/5130804 to your computer and use it in GitHub Desktop.
This is Batch tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function Batch($BatchNo){ | |
if($BatchNo==1){ | |
return "First Batch"; | |
} | |
else if($BatchNo==2){ | |
return "Second Batch"; | |
} | |
else if($BatchNo==3){ | |
return "Third Batch"; | |
} | |
else if(substr($BatchNo,-1)==1){ | |
if($BatchNo-1==10 || $BatchNo-1==110){ | |
return $BatchNo."th Batch"; | |
} | |
else{ | |
return $BatchNo-1 ." First Batch"; | |
} | |
} | |
else if(substr($BatchNo,-1)==2){ | |
if($BatchNo-2==10 || $BatchNo-2==110){ | |
return $BatchNo."th Batch"; | |
} | |
else{ | |
return $BatchNo-2 ." Second Batch"; | |
} | |
} | |
else if(substr($BatchNo,-1)==3){ | |
if($BatchNo-3==10 ||$BatchNo-3==110){ | |
return $BatchNo."th Batch"; | |
} | |
else{ | |
return $BatchNo-3 ." Third Batch"; | |
} | |
} | |
else{ | |
return $BatchNo."th Batch"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment