
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
PHP class notes with sylabus - unit 1
Typology: Lecture notes
1 / 40
This page cannot be seen from the preview
Don't miss anything!
PHP Scripting Language
Essentials of PHP - Operators and Flow Control - Strings and Arrays
output any text, such as XHTML and XML.
Software’s required to execute PHP application:
E.g.: Microsoft IIS, Apache, Xitami, sambar server etc.,
The current version used is PHP6.
Any web browser available in the system can be used.
“Here” documents
E.g: Program 1.
Interpolating string:
E.g. echo “value in x is” , $x ;
$type="basket"; echo "$typeball"; ?> The above echo will produce error Notice It should be altered like,: Undefined variable: typeball in C:\xampp\htdocs\prg1-9.PHP on line 3. echo “$type ball”; Where the output will be,
echo “{$type}ball”; This will return “basketball”.
E.g. echo ‘$type ball’; This will return $type ball.
E.g. Echo “$type ball”; This would return “$type ball”.
Creating Variable Variables:
E.g. Program1.
Eg: Program 1.
",$i; ?>is_int (), is_float (), is_array (), and so on.
Operator Operation Example Result == Equal $a == $b TRUE if $a is equal to $b === Identical $a === $b TRUE if $a is equal to $b, and they are of the same type. != Not equal $a != $b TRUE if $a is not equal to $b <> Not equal $a <> $b TRUE if $a is not equal to $b !== Not Identical $a !== $b TRUE if $a is not equal to $b, or they are not of the same type. < Less than $a < $b True if $a is strictly less than $b
Greater than $a > $b True if $a is strictly greater than $b <= Less than or equal to $a <= $b True if $a is less than or equal to $b = Greater than or equal to $a >= $b True if $a is greater than or equal to $b
E.g: Program 1.
warning "; echo "Operator Operation Example Result and And $a and $b TRUE if both $a and $b are TRUE or Or $a or $b TRUE if both $a or $b is TRUE xor Xor $a xor $b TRUE if either $a or $b are TRUE, but not both ! Not !$a TRUE if $a is not TRUE && And $a && $b TRUE if both $a and $b are TRUE || Or $a || $b TRUE if either $a and $b is TRUE
‘&&’ and ‘and’ both work the same way, as is ‘||’ and ‘or’.
Eg: Program 1.
floor(no1) = ".floor($no1); echo "If statement:
The else Statement:
Switch Statement
Syntax: switch (test value) { case expr 1: stamt1; [break;] case expr 2: stmt2; [break;] case expr 3; stmt3; [break;] . . . [default: Default stmt:] }
E.g: Program 1.
For loop