Skip to content

Commit 1a75de8

Browse files
done
1 parent 2c4f451 commit 1a75de8

14 files changed

Lines changed: 253 additions & 12 deletions

HelloWorld.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<html>
2-
<body>
31
<?php
4-
echo "Hello,World!";
5-
?>
6-
</body>
7-
8-
<footer style="position:fixed; left:0; right:0; bottom:0; background:#f8f8f8; padding:10px 0; text-align:center; border-top:1px solid #e0e0e0; font-family:Arial, sans-serif;">
9-
<strong>Code Is Writen By <a href="https://www.linkedin.com/in/parasgupta-binary0101">Paras Gupta</a></strong>
10-
</footer>
11-
</html>
2+
echo "Hello World | My ERP: 0231BCA189"
3+
?>

Numeric_array.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
<head>
3+
<title>
4+
PHP NUMERIC ARRAY
5+
</title>
6+
</head>
7+
<body>
8+
<?php
9+
$number = array(1, 2, 3, 4, 5);
10+
11+
foreach ($number as $value) {
12+
echo "Value is $value\n";
13+
}
14+
15+
$number[0] = "One";
16+
$number[1] = "Two";
17+
$number[2] = "Three";
18+
$number[3] = "Four";
19+
$number[4] = "Five";
20+
21+
foreach ($number as $value) {
22+
echo "Value is $value\n";
23+
}
24+
25+
?>
26+
</body>
27+
<footer style="position:fixed; left:0; right:0; bottom:0; background:#f8f8f8; padding:10px 0; text-align:center; border-top:1px solid #e0e0e0; font-family:Arial, sans-serif;">
28+
<strong>Code Is Writen By <a href="https://www.linkedin.com/in/parasgupta-binary0101">Paras Gupta</a></strong>
29+
</footer>
30+
</html>

as-array.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$salaries = array("roshan"=>2000, "twinkle"=>1000, "zara"=>500);
4+
5+
echo "Salary of Roshan is " . $salaries['roshan'] . "\n<br>";
6+
echo "Salary of Twinkle is " . $salaries['twinkle'] . "\n<br>";
7+
echo "Salary of Zara is " . $salaries['zara'] . "\n<br>";
8+
9+
$salaries['roshan'] = "high";
10+
$salaries['qadir'] = "medium";
11+
$salaries['twinkle'] = "low";
12+
13+
echo "Salary of Roshan is " . $salaries['roshan'] . "\n<br>";
14+
echo "Salary of Twinkle is " . $salaries['twinkle'] . "\n<br>";
15+
echo "Salary of Zara is " . $salaries['zara'] . "\n<br>";
16+
17+
?>

code1.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
$income;
3+
4+
switch($income){
5+
case($income<500000):
6+
$tax=0;
7+
case($income>=500000 and inc)
8+
9+
10+
}
11+
12+
?>

control_statments.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<html>
2+
<head>
3+
<title>
4+
PHP CONTROL STATMENTS
5+
</title>
6+
</head>
7+
<body>
8+
<?php
9+
10+
$a=10;
11+
$b=20;
12+
13+
if($a<$b)
14+
{
15+
echo "Out of $a and $b,$a is smaller: ";
16+
}
17+
?>
18+
</body>
19+
<footer style="position:fixed; left:0; right:0; bottom:0; background:#f8f8f8; padding:10px 0; text-align:center; border-top:1px solid #e0e0e0; font-family:Arial, sans-serif;">
20+
<strong>Code Is Writen By <a href="https://www.linkedin.com/in/parasgupta-binary0101">Paras Gupta</a></strong>
21+
</footer>
22+
</html>

factoral.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
$number = 4200;
4+
$factors = array();
5+
$count = 0;
6+
7+
for ($i = 1; $i <= $number; $i++) {
8+
9+
if ($number % $i == 0) {
10+
$factors[] = $i;
11+
$count++;
12+
}
13+
14+
if ($count == 10) {
15+
break;
16+
}
17+
}
18+
19+
foreach ($factors as $factor) {
20+
echo "factor is " . $factor . "<br>";
21+
}
22+
23+
?>

function.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
function test(){
3+
$greet = "hello world";
4+
echo $greet;
5+
}
6+
test();
7+
echo $greet;
8+
?>

if_else.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<html>
2+
<head>
3+
<title>
4+
PHP IF AND ELSE STATMENTS
5+
</title>
6+
</head>
7+
<body>
8+
<?php
9+
10+
$a=20;
11+
$b=15;
12+
13+
if($a<$b)
14+
{
15+
echo "$a is bigger than $b";
16+
}
17+
else
18+
{
19+
echo "$a is NOT bigger than $b";
20+
}
21+
?>
22+
</body>
23+
<footer style="position:fixed; left:0; right:0; bottom:0; background:#f8f8f8; padding:10px 0; text-align:center; border-top:1px solid #e0e0e0; font-family:Arial, sans-serif;">
24+
<strong>Code Is Writen By <a href="https://www.linkedin.com/in/parasgupta-binary0101">Paras Gupta</a></strong>
25+
</footer>
26+
</html>

if_else_if_statments.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
<head>
3+
<title>
4+
PHP IF,ELSE AND IF STATMENTS
5+
</title>
6+
</head>
7+
<body>
8+
<?php
9+
10+
$a=45;
11+
$b=70;
12+
13+
if($a>$b)
14+
{
15+
echo "$a is bigger than $b";
16+
}
17+
elseif($a==$b)
18+
{
19+
echo "$a is equal to $b";
20+
}
21+
else
22+
{
23+
echo "$a is NOT bigger than $b";
24+
}
25+
?>
26+
</body>
27+
<footer style="position:fixed; left:0; right:0; bottom:0; background:#f8f8f8; padding:10px 0; text-align:center; border-top:1px solid #e0e0e0; font-family:Arial, sans-serif;">
28+
<strong>Code Is Writen By <a href="https://www.linkedin.com/in/parasgupta-binary0101">Paras Gupta</a></strong>
29+
</footer>
30+
</html>

multidimensional.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
//Write a PHP program to demonstrate the use of a multidimensional array.
4+
5+
$marks = array(
6+
"roshan" => array(
7+
"physics" => 35,
8+
"maths" => 30,
9+
"chemistry" => 39
10+
),
11+
12+
"twinkle" => array(
13+
"physics" => 30,
14+
"maths" => 32,
15+
"chemistry" => 29
16+
),
17+
18+
"zara" => array(
19+
"physics" => 31,
20+
"maths" => 22,
21+
"chemistry" => 39
22+
)
23+
);
24+
25+
/* Accessing multi-dimensional array values */
26+
echo "Marks for Roshan in physics : " ;
27+
echo $marks['roshan']['physics'] . "\n<br>";
28+
29+
echo "Marks for Twinkle in maths : ";
30+
echo $marks['twinkle']['maths'] . "\n<br>";
31+
32+
echo "Marks for Zara in chemistry : " ;
33+
echo $marks['zara']['chemistry'] . "\n<br>";
34+
?>

0 commit comments

Comments
 (0)