├── Area.php ├── BodeMassIndex.php ├── OTP.php ├── ageCalculator.php ├── capcha.php ├── capitalSmall.php ├── currencyConverter.php ├── dynamicHeading.php ├── function.php ├── grade.php ├── loop.php ├── namta.php └── passwordGenerator.php /Area.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BodeMassIndex.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OTP.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ageCalculator.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /capcha.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /capitalSmall.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /currencyConverter.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dynamicHeading.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /function.php: -------------------------------------------------------------------------------- 1 | =80 && $marks<=100){ 10 | echo "You Got A+ & your Grade is 5.00"; 11 | } 12 | else if($marks>=70 && $marks<=79){ 13 | echo "You Got A & your Grade is 4.40"; 14 | } 15 | else if($marks>=60 && $marks<=69){ 16 | echo "You Got A- & your Grade is 3.50"; 17 | } 18 | else if($marks>=50 && $marks<=59){ 19 | echo "You Got B & your Grade is 3.00"; 20 | } 21 | else if($marks>=40 && $marks<=49){ 22 | echo "You Got C & your Grade is 2.00"; 23 | } 24 | else if($marks>=33 && $marks<=39){ 25 | echo "You Got D & your Grade is 1.00"; 26 | } 27 | else if($marks>=0 && $marks<=32){ 28 | echo "You Got F"; 29 | } 30 | else{ 31 | echo "Please Enter Valid Number"; 32 | } 33 | } 34 | 35 | /** 36 | * Rectangle Square Circle 37 | */ 38 | 39 | function getArea($type=null, $length , $height){ 40 | $area=""; 41 | $area_type=""; 42 | 43 | switch ($type) { 44 | case 'r': 45 | $area= $length * $height; 46 | $area_type="Rectangle"; 47 | break; 48 | case 's': 49 | $area= $length * $length; 50 | $area_type="Square"; 51 | break; 52 | case 'c': 53 | $area= 3.1416*($length * $length); 54 | $area_type="Circle"; 55 | break; 56 | 57 | default: 58 | echo "Something Went Wrong."; 59 | break; 60 | } 61 | 62 | echo "Area of {$area_type} is {$area}"; 63 | } 64 | 65 | /** 66 | * Age Calculator 67 | */ 68 | 69 | function checkAge($birthYear){ 70 | $age=2022-$birthYear; 71 | return "Your birth year {$birthYear} & now you're {$age} years old."; 72 | } 73 | 74 | /** 75 | * Dynamic headline 76 | */ 77 | 78 | function heading($title=null, $type='h1', $align='center', $fontFamily='arial', $fontSize=14, $color='red'){ 79 | return "<{$type} style='text-align:{$align};font-family:{$fontFamily};font-size:{$fontSize};color:{$color};'>{$title}"; 80 | } 81 | 82 | /** 83 | * Body Mass Index 84 | */ 85 | 86 | 87 | function BodyMassIndex($weight,$height){ 88 | $BMI=$weight/($height*$height); 89 | if ($BMI<18.5) { 90 | echo "Your Height is {$height} Meter
Weight is {$weight} KG
Your BMI is {$BMI} & You're Underweight"; 91 | } 92 | else if ($BMI>=18.5 && $BMI<=24.9) { 93 | echo "Your Height is {$height} Meter
Weight is {$weight} KG
Your BMI is {$BMI} & You're Normal weight"; 94 | } 95 | else if ($BMI>=25 && $BMI<=29.9) { 96 | echo "Your Height is {$height} Meter
Weight is {$weight} KG
Your BMI is {$BMI} & You're Overweight"; 97 | } 98 | else if ($BMI>=30) { 99 | echo "Your Height is {$height} Meter
Weight is {$weight} KG
Your BMI is {$BMI} & You're Obesity"; 100 | } 101 | } 102 | /** 103 | * Corrency Converter 104 | */ 105 | 106 | function currencyConvert($amount=null,$currency=null){ 107 | 108 | switch ($currency) { 109 | case 'usd': 110 | echo "$amount USD = " . 86.12 * $amount . " BDT"; 111 | break; 112 | 113 | case 'cad': 114 | echo "$amount CAD = " . 67.93 * $amount . " BDT"; 115 | break; 116 | case 'pound': 117 | echo "$amount POUND = " . 113.25 * $amount . " BDT"; 118 | break; 119 | case 'euro': 120 | echo "$amount EURO = " . 95.03 * $amount . " BDT"; 121 | break; 122 | case 'won': 123 | echo "$amount WON = " . 0.07 * $amount . " BDT"; 124 | break; 125 | 126 | default: 127 | echo "Please select currency"; 128 | break; 129 | } 130 | } 131 | 132 | /** 133 | * Capital Small 134 | */ 135 | function capitalSmall($text=null, $type=null ){ 136 | 137 | switch ($type) { 138 | case 'c': 139 | echo "

{$text}

"; 140 | break; 141 | 142 | case 's': 143 | echo "

{$text}

"; 144 | break; 145 | 146 | default: 147 | echo "Something Wont Wrong"; 148 | break; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /grade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /loop.php: -------------------------------------------------------------------------------- 1 | "; 5 | for ($i=10000; $i <=10050 ; $i++) { 6 | echo "$i
"; 7 | } 8 | echo "Increment Stop


"; 9 | 10 | 11 | //Decrement 12 | echo "Decrement Start
"; 13 | for ($i=10000; $i >=9950 ; $i--) { 14 | echo "$i
"; 15 | } 16 | echo "Decrement Stop

"; 17 | 18 | //Divided By 3 & 4 19 | 20 | for ($i=1; $i<=500 ; $i++) { 21 | if($i%3==0 && $i%4==0){ 22 | echo "$i divided by 3 & 4
"; 23 | } 24 | } 25 | echo "

"; 26 | 27 | 28 | //exit if any number divided by 11 29 | 30 | for ($i=1; $i <=1000 ; $i+=3) { 31 | if($i%11==0){ 32 | echo "$i divided by 11 & that's why program stop working."; 33 | break; 34 | } 35 | else { 36 | echo "$i
"; 37 | } 38 | } 39 | 40 | ?> -------------------------------------------------------------------------------- /namta.php: -------------------------------------------------------------------------------- 1 | "; 5 | for ($i=1; $i <=10 ; $i++) { 6 | $result= $input*$i; 7 | echo "{$input} X {$i} = {$result}
"; 8 | } 9 | $input=3; 10 | echo "3 er namta
"; 11 | for ($i=1; $i <=10 ; $i++) { 12 | $result= $input*$i; 13 | echo "{$input} X {$i} = {$result}
"; 14 | } 15 | $input=4; 16 | echo "4 er namta
"; 17 | for ($i=1; $i <=10 ; $i++) { 18 | $result= $input*$i; 19 | echo "{$input} X {$i} = {$result}
"; 20 | } 21 | $input=5; 22 | echo "5 er namta
"; 23 | for ($i=1; $i <=10 ; $i++) { 24 | $result= $input*$i; 25 | echo "{$input} X {$i} = {$result}
"; 26 | } 27 | ?> -------------------------------------------------------------------------------- /passwordGenerator.php: -------------------------------------------------------------------------------- 1 | ?/{}[]()!@#$%^&*"),2,8); 4 | 5 | ?> --------------------------------------------------------------------------------