Lecture Web technologies and programming – Lecture 23: Introduction to PHP (Part 2) - TRƯỜNG CÁN BỘ QUẢN LÝ GIÁO DỤC THÀNH PHỐ HỒ CHÍ MINH

20 12 0
Lecture Web technologies and programming – Lecture 23: Introduction to PHP (Part 2) - TRƯỜNG CÁN BỘ QUẢN LÝ GIÁO DỤC THÀNH PHỐ HỒ CHÍ MINH

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

17 Variable Declared Incremented Before Display Incremented After Display Displaying Incremented Value.. 19[r]

(1)(2)(3)

Setting the environment

PHP overview

What is a PHP File

Open-source

Platform independent

What Can PHP Do?

Why PHP?

Basic PHP Syntax

Writing and Executing PHP Code

PHP constants

Constants are Global

PHP variables

LocalGlobalStatic

Type Determination

PHP Strings

PHP is a Loosely Typed Language

(4)

Operators in PHP

Conditional Statements in PHP

Looping Statements

Arrays in PHP

(5)

5

Operators are used to perform operations on

variables and values.

PHP divides the operators in the following groups:Arithmetic operators

Assignment operatorsString operators

Increment/Decrement operatorsLogical operators

Comparison operatorsEquality Operators

(6)

6

Arithmetic Operators:

The PHP arithmetic operators are used

with numeric values to perform common

arithmetical operations, such as addition,

subtraction, multiplication etc

(7)

7

Assignment Operators:

The PHP assignment operators are

used with numeric values to write a value to a variable.

The basic assignment operator in PHP

is "=" It means that the left operand gets set to the value of the assignment expression on the right.

=

+= ($a +=$b ), *= , /=

(8)(9)

9

String Operators:

PHP has two operators that are specially

designed for strings • , .=

(10)

10

String

(11)

11

First Variable

Second Variable

Concatenation

(12)(13)

13

Adds $b in $a

(14)(15)

15

Increment/decrement Operators:

The PHP increment operators are used

to increment a variable's value.

The PHP decrement operators are used

to decrement a variable's value.

++ ,

(16)

16

(17)(18)(19)

19

Logical Operators:

The PHP logical operators are used to

combine conditional statements

(20)

20

Ngày đăng: 01/04/2021, 16:12

Tài liệu cùng người dùng

Tài liệu liên quan