-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratch1.php
40 lines (31 loc) · 866 Bytes
/
scratch1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
//comments in php - single line comment
# this is also a single line comment
/*
this is multiline comment you can also use commnets to leave out parts of a code line
*/
// echo command is not a function and there is no need to write with parenthesis but when we have to use more than one parameter it is reqired to use ().
/*
Syntax : void echo(string $arg1[,string $...])
echo is faster then print statement
*/
$msg = "This is a Message!";
$res = addcslashes($msg,"M");
echo $res;
$str = addslashes('this is an "Exam" of php');
echo $str."<br>";
$str = bin2hex("Hello World!");
echo $str;
//varibale decaration
//String
$str = "String";
//int
$num = 200;
// double
$nums = 44.9;
echo "string is: $str";
echo "Integer is :".$num;
echo "float is :".$nums;
//varibales are case sensitive
//$name and $NAME are consider as diffrent variables
?>