lecture 1.0 by mazen abdulaziz
DESCRIPTION
Lecture 1.0 By Mazen Abdulaziz. ” إن الل ـ ه يحب إذا عمل أحدكم عملا ً أن يتقنه “. 1.0 PHP is running. 1.1 Variables. 1.1 Variables. 1.1 Variables. 1.1 Variables. 1.1 Variables. 1.2 Constants. 1.3 Operators. Next…. - PowerPoint PPT PresentationTRANSCRIPT
Lecture 1.0By Mazen Abdulaziz
الل ” عمال ـإن أحدكم عمل إذا يحب ً هيتقنه “أن
1.0 PHP is running
phpinfo()
echo(“Hello World!”);
echo “<b>Hello world</b>”;
<b><?php echo ‘hello world’?></b>
1.1 Variables
$x = 10; // integer
$y = 1.2; // integer
$z = "hello there"; // string
$foo = ‘1.231’; // also string
1.1 Variables
$a = 1; // a is an int
$a = 1.2; // now it’s a double
$a = “straw”; // it’s a string now
echo $a;
1.1 Variables
$a = 1;
$b = 1.2;
$c = “1st”;
$v = $a + $b; // $v is double
$q = 1 + $c;
echo $v . “ “ . $c;
1.1 Variables
// Useful operations
gettype( $var );
settype( $var, $type );
isset( $var );
unset( $var );
is_...( $var );
...val( $var );
1.1 Variables
$foo = “bike”;
echo “I have a $foo”;
echo ‘I have a $foo’;
echo “${foo}boo”;
1.2 Constants
define( “PI”, 3.14 );
define( “NL”, “<br>” );
define( “VERSION”, “1.2b” );
echo PI;
echo VERSION;
echo defined(NL);
1.3 Operators
Binary: + - * / % .
Assignment: += -= *= /= %= .= ++ --
Comparison: == > < >= <= != <>
Logical: && || or and xor !
Ternary: ( expr ? expr : expr )
Bitwise: & | ^ ! >> <<
Next…
- Loops- Functions- Arrays
Sayonara!