PHP Handout Vol. 3 PHP tutorial

PHP Handout Vol. 3  PHP tutorialBASICS OF PHP SCRIPT LANGUAGE
-Incorporate HTML and PHP in the same document
-Define and Access variables and Use constants
-Use operators to create expressions and data types
-Use the “if, switch, while, for” statements to make loops or execute alternative blocks of code.
-Define and call functions : statically, dynamically and anonymously
-Pass data to functions : by value and by reference
-Access data from and about Arrays
-Access and sort the data contained in arrays
-Format, Replace, Change, Find a Substring, within Strings


Beginning and Ending a Block of PHP Statements
When writing PHP, you need to inform the PHP engine that you want it to execute your commands. If you don’t do this, the code you write will be mistaken for HTML and will be output to the browser. You can do this with special tags that mark the beginning and end of PHP code blocks. Table 1 lists four such PHP delimiter tags.

A statement represents an instruction to the PHP engine. Broadly, it is to PHP what a sentence is to written or spoken English. A sentence should end with a period; a statement should usually end with a semicolon. Exceptions to this include statements that enclose other statements and statements that end a block of code. In most cases, however, failure to end a statement with a semicolon confuses the PHP engine and results in an error being reported at the following line in the script.

Different types of data take up different amounts of memory and can be treated differently when they are manipulated in a script. Some programming languages therefore demand that the programmer declare in advance which type of data a variable will contain. By contrast, PHP is loosely typed, which means it calculates data types as data is assigned to each variable.

Website: ui-n2.loria.fr | Filesize: 607kb
No of Page(s): 127
Click here to download PHP Handout Vol. 3 PHP tutorial.

Related Tutorial

Tags: , , , , , , , , , , , ,

Comments

Leave a Reply