Zusammenfassung der Ressource
PHP intro
- Sintakse
Anmerkungen:
- http://www.w3schools.com/php/php_syntax.asp
- Pēdiņas
- ( ' ... ' ) Rakstītais netiek interpretēts (kā teksts)
- ( " ..." ) Ietvertie operatori darbojas
- Komentāri
- /* ... */ Bloks - no ... līdz
- // Rinda - lidz r. beigām
- Teksta dalījums
- ( ; ) rindas beigas
- Funkcijas bloks {
...
}
- Variabļi
Anmerkungen:
- http://www.w3schools.com/php/php_variables.asp
- = "Teksts pēdiņās", skaitlis
- $_variablis, $veelViens
- Case-sensitive, A-z, 0-9, _
- local, global, static
- local
global
static
- Operatori
- Arithmetic
Compraison
String
Assignment
Combination
Anmerkungen:
- http://www.w3schools.com/php/php_operators.asp
- assignment op. " = "
- string concatenation op. " . "
- vienāds " == ", nav vienāds " != ", identisks " === " ( vērtība un tips )
- x += y ( x = x + y ) ; x -= y ( x = x - y )
- ++$x ( $x +1 ) --$x ($x - 1 )
- Funkcijas > 1000
Anmerkungen:
- http://www.w3schools.com/php/php_functions.asp
- Besides the built-in PHP functions, we can create our own functions.
A function is a block of statements that can be used repeatedly in a program.
A function will not execute immediately when a page loads.
A function will be executed by a call to the function.
- NOT case-sensitive
- argument ~= variable
- function familyName($fname)
- function MyFunction($myArgs)
- function MyFunc($arg1, $arg2, $arg3 = "Default value")
- Masīvi
Anmerkungen:
- http://www.w3schools.com/php/php_arrays.asp
- PHP 5 Array Functions
http://www.w3schools.com/php/php_ref_array.asp
- Indexed - with a numeric index
- Associative - with named keys
- Multidimensional containing one or more arrays
- Cikli
- while Loops
Anmerkungen:
- http://www.w3schools.com/php/php_looping.asp
- for Loops
Anmerkungen:
- http://www.w3schools.com/php/php_looping_for.asp
- Nosacījumu vadība: if..else, switch
Anmerkungen:
- http://www.w3schools.com/php/php_if_else.asp
http://www.w3schools.com/php/php_switch.asp
- Konstantes
Anmerkungen:
- http://www.w3schools.com/php/php_constants.asp
- define(name, value, case-insensitive)
- String Functions
- strlen, str_word_count
- External PHP
Anmerkungen:
- include and require
http://www.w3schools.com/php/php_includes.asp
- include "<filename>"
include_once "<fn>"
require "<fn>"
require_once "<fn>"