Skip to content

Commit 07d2030

Browse files
authored
Add files via upload
1 parent d82e40a commit 07d2030

16 files changed

+333
-0
lines changed

arithmetic_operators.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
$a=10;
3+
$b=3;
4+
5+
$c=$a+$b;
6+
$d=$a-$b;
7+
$e=$a*$b;
8+
$f=$a/$b;
9+
$g=$a**$b;
10+
$a++;
11+
$b--;
12+
13+
// echo $c;
14+
// echo $d;
15+
// echo $e;
16+
// echo $f;
17+
// echo $g;
18+
echo $a;
19+
echo $b;
20+
?>

arrays.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
$lang= array("Java","Python","C++","Javascript");
3+
// echo $lang; //error
4+
echo $lang[0];
5+
echo "<br>";
6+
echo count($lang);
7+
?>

assignment_operators.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
$a=10;
3+
4+
$new =$a;
5+
// $new += 1;
6+
// $new -= 2;
7+
// $new *= 5;
8+
$new /= 2;
9+
10+
echo "The value of 'new' is ";
11+
echo $new;
12+
?>

code_structure_2.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<title>Hello</title>
4+
</head>
5+
<body>
6+
<?php
7+
echo "Hello Tanmoy";
8+
?>
9+
</body>
10+
</html>

comments_6.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
$x=25; //comment1
3+
echo $x; #comment2
4+
5+
/*echo "<h1>" .$x. "</h1>";
6+
echo "<b>" .$x. "</b>";*/
7+
8+
?>

comparison_operators.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
echo "The value of 1==4 is ";
3+
echo var_dump(1==4);
4+
echo "<br>";
5+
echo "The value of 1!=4 is ";
6+
echo var_dump(1!=4);
7+
echo "<br>";
8+
echo "The value of 1>=4 is ";
9+
echo var_dump(1>=4);
10+
echo "<br>";
11+
echo "The value of 1<=4 is ";
12+
echo var_dump(1<=4);
13+
echo "<br>";
14+
echo "The value of 1>4 is ";
15+
echo var_dump(1>4);
16+
echo "<br>";
17+
echo "The value of 1<4 is ";
18+
echo var_dump(1<4);
19+
20+
?>

constant_variables_7.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
$x=500;
3+
$x=200;
4+
echo $x;
5+
6+
$x="Tanmoy";
7+
echo $x."<br>";
8+
9+
define("num",30);
10+
echo num."<br>";
11+
/*define("num",10); #It'll not work as 'num' is a constant variable
12+
echo num;*/
13+
14+
define("_num",111);
15+
echo _num."<br>";
16+
// echo _NUM."<br>"; #It'll not work as case-insensitive: false(by default)
17+
define("num1",10101,true);
18+
echo num1."<br>";
19+
echo NUM1."<br>";
20+
21+
define("_num23",233223);
22+
echo _num23."<br>";
23+
24+
$sum= _num+20;
25+
echo $sum;
26+
?>

datatypes_5.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
$x= "Tanmoy";
3+
echo $x . "<br>";
4+
var_dump($x);
5+
6+
echo "<br>";
7+
8+
$y= 25;
9+
var_dump($y);
10+
11+
echo "<br>";
12+
13+
$y1= "25";
14+
var_dump($y1);
15+
16+
echo "<br>";
17+
18+
$y2= '25';
19+
var_dump($y2);
20+
21+
echo "<br>";
22+
23+
$y3= 5.546;
24+
var_dump($y3);
25+
26+
echo "<br>";
27+
28+
$y4= true;
29+
echo $y4. "<br>";
30+
var_dump($y4);
31+
32+
echo "<br>";
33+
34+
$p= array("html","css","js");
35+
echo $p . "<br>";
36+
echo $p[0] . "<br>";
37+
var_dump($p);
38+
39+
echo "<br>";
40+
41+
$y5= null;
42+
echo $y5. "<br>";
43+
var_dump($y5);
44+
?>

echo_and_print_3.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
echo "Hello";
3+
echo 'Hello';
4+
echo "Tanmoy Das";
5+
echo "Tanmoy", "Das";
6+
echo 45.23;
7+
echo "Tan".(123);
8+
echo ("Myself");
9+
echo "<b><i>Hell</i></b>";
10+
echo "<h1>23.56</h1>";
11+
print "hell";
12+
print "heaven";
13+
?>

first_1.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
echo "Hello World";
3+
?>

0 commit comments

Comments
 (0)