lecture 1.0 by mazen abdulaziz

13
Lecture 1.0 By Mazen Abdulaziz

Upload: kim-sherman

Post on 30-Dec-2015

33 views

Category:

Documents


2 download

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 Presentation

TRANSCRIPT

Page 1: Lecture 1.0 By Mazen Abdulaziz

Lecture 1.0By Mazen Abdulaziz

Page 2: Lecture 1.0 By Mazen Abdulaziz

الل ” عمال ـإن أحدكم عمل إذا يحب ً هيتقنه “أن

Page 3: Lecture 1.0 By Mazen Abdulaziz

1.0 PHP is running

phpinfo()

echo(“Hello World!”);

echo “<b>Hello world</b>”;

<b><?php echo ‘hello world’?></b>

Page 4: Lecture 1.0 By Mazen Abdulaziz

1.1 Variables

$x = 10; // integer

$y = 1.2; // integer

$z = "hello there"; // string

$foo = ‘1.231’; // also string

Page 5: Lecture 1.0 By Mazen Abdulaziz

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;

Page 6: Lecture 1.0 By Mazen Abdulaziz

1.1 Variables

$a = 1;

$b = 1.2;

$c = “1st”;

$v = $a + $b; // $v is double

$q = 1 + $c;

echo $v . “ “ . $c;

Page 7: Lecture 1.0 By Mazen Abdulaziz

1.1 Variables

// Useful operations

gettype( $var );

settype( $var, $type );

isset( $var );

unset( $var );

is_...( $var );

...val( $var );

Page 8: Lecture 1.0 By Mazen Abdulaziz

1.1 Variables

$foo = “bike”;

echo “I have a $foo”;

echo ‘I have a $foo’;

echo “${foo}boo”;

Page 9: Lecture 1.0 By Mazen Abdulaziz
Page 10: Lecture 1.0 By Mazen Abdulaziz
Page 11: Lecture 1.0 By Mazen Abdulaziz

1.2 Constants

define( “PI”, 3.14 );

define( “NL”, “<br>” );

define( “VERSION”, “1.2b” );

echo PI;

echo VERSION;

echo defined(NL);

Page 12: Lecture 1.0 By Mazen Abdulaziz

1.3 Operators

Binary: + - * / % .

Assignment: += -= *= /= %= .= ++ --

Comparison: == > < >= <= != <>

Logical: && || or and xor !

Ternary: ( expr ? expr : expr )

Bitwise: & | ^ ! >> <<

Page 13: Lecture 1.0 By Mazen Abdulaziz

Next…

- Loops- Functions- Arrays

Sayonara!