Presentation is loading. Please wait.

Presentation is loading. Please wait.

PHP-language Variables, assingment and arithmetic operations

Similar presentations


Presentation on theme: "PHP-language Variables, assingment and arithmetic operations"— Presentation transcript:

1 PHP-language Variables, assingment and arithmetic operations
Jouni Juntunen Oulu University of Applied Sciences School of Business and Information Management

2 Variables Data prosessed by (web) application is store into variables
PHP-application is executed on web server -> variables are into memory of the web server When you declare a variable, you don’t give datatype (but still variables do have datatype) -> PHP is so called loosely-typed programming language Basic datatypes: boolean, integer, floating point number and string

3 Declaring variables Variable declaring starts with $-character
You invent the name for the variable Good practise is to give initial value Example: $somenumber=0; $sometext=””; $isTrue=false;

4 Assignment (= operator)
Assingment is used to store data into variable User input Result of an clause Examples. $name=$_POST[”txtName”]; $total=$number1 + $number2; $fullname=$forname . $surname;

5 Arithmetic operations
+ addition - subtraction / division * multiplication % remainder

6 Reading values from HTML-form using HTTP-post method

7 Printing information with PHP
echo, print ja printf


Download ppt "PHP-language Variables, assingment and arithmetic operations"

Similar presentations


Ads by Google