Skip to content

Commit 1478dc2

Browse files
done
1 parent 7a1f655 commit 1478dc2

3 files changed

Lines changed: 83 additions & 15 deletions

File tree

HelloWorld.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
<html>
2+
<body>
13
<?php
2-
echo "Hello World | My ERP: 0231BCA189"
3-
?>
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>

Operator.php

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
* 5) Logical operator --> (&&),(||),(!)
2828
* 6) String operator (Also called Concat operator) --> (.),(.=)
2929
* 7) Array operator
30-
* 8) Conditional assignment operator
30+
* 8) Conditional assignment operator --> (?)(:)
3131
*
3232
***/
3333

3434
//Arithmetic oprators in code:
35-
echo "Arithmetic Oprators:<br>";
35+
echo "<span style='color:red;'>Arithmetic Oprators:</span><br>";
3636
echo "<br>";
3737
echo "10+20= ".(10+20)."<br>";
3838
echo "10-10= ".(10-10)."<br>";
@@ -46,7 +46,7 @@
4646
$b=60;
4747
$c=50;
4848

49-
echo "Relational Oprators:<br>";
49+
echo "<span style='color:red;'>Relational Oprators:</span><br>";
5050
echo "<br>";
5151
echo "50<60= ".($a<$b)."<br>";
5252
echo "50>60= ".($a>$b)."<br>";
@@ -74,7 +74,7 @@
7474
//Increment/Decrement operator
7575
$a=50;
7676

77-
echo "Increment/Decrement operator:<br>";
77+
echo "<span style='color:red;'>Increment/Decrement operator:</span><br>";
7878
echo "<br>";
7979
echo "a=a+1= ".(++$a)."<br>"; // $a=$a+1 --> Pre Increment
8080
echo "a=a+1= ".($a++)."<br>"; // $a=$a+1 --> Post Increment
@@ -112,7 +112,7 @@
112112
$a=50;
113113
$b=60;
114114

115-
echo "Logical operator:<br>";
115+
echo "<span style='color:red;'>Logical operator:</span><br>";
116116
echo "<br>";
117117

118118
// (&&) AND operator
@@ -155,6 +155,48 @@
155155
*
156156
* ***/
157157

158+
//String operator (Concat operator)
159+
echo "<span style='color:red;'>String operator (Concat operator):</span><br>";
160+
echo "<br>";
161+
162+
// String operator of (.)
163+
164+
$a=100;
165+
echo "Value is: ".$a;
166+
167+
// String operator of (.=)
168+
169+
$a=100;
170+
$b=10;
171+
$a.=$b; //10010
172+
173+
echo $a."<br>";
174+
echo "<br>";
175+
176+
//Conditional assignment operator
177+
echo "<span style='color:red;'>Conditional assignment operator: </span><br>";
178+
echo "<br>";
179+
180+
//Conditional assignment operator for (?)
181+
$a=500;
182+
$b=1000;
183+
$str=$a>$b? "A is the Grater":"B is the Grater";
184+
185+
echo $str."<br>";
186+
187+
/***
188+
* Q3. Now What Will Be Output Of This Code:
189+
*
190+
* $str=500? "Hello":"Bye";
191+
* echo $str;
192+
*
193+
*
194+
* Answer: Hello (Becouse it takes 1 as True)
195+
*
196+
* ***/
197+
198+
echo "<br>";
199+
158200
?>
159201
</h1>
160202
</body>

function.php

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
<?php
2-
function test(){
3-
$greet = "hello world";
4-
echo $greet;
5-
}
6-
test();
7-
echo $greet;
8-
?>
1+
<html>
2+
<head>
3+
<title>Function In PHP</title>
4+
</head>
5+
<body>
6+
<center>
7+
<h1>
8+
<?php
9+
function display(){// Definition of function
10+
echo "This is a function code<br>";
11+
}
12+
function sum($a,$b){
13+
$c=$a+$b;
14+
echo "Addition is: ".$c."<br>";
15+
}
16+
display(); //calling of function
17+
sum(50,20); //Arguments
18+
echo "End Program";
19+
?>
20+
</h1>
21+
</center>
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>

0 commit comments

Comments
 (0)