Introduction To PHP
Introduction To PHP
BSIT721 ADDPROG2
Sir EVC
Assignment:
What is PHP?
o
PHP is a programming language that can do all sorts of things: evaluate form data
sent from a browser, build custom web content to serve the browser, talk to a
database, and even send and receive cookies.
PHP is a server scripting language, and a powerful tool for making dynamic and
interactive Web pages.
PHP variables
o
A variable can have a short name (like x and y) or a more descriptive name (age,
carname, total_volume).
PHP Functions
o
The real power of PHP comes from its functions; it has more than 1000 built-in
functions.
Arguments are specified after the function name, inside the parentheses. You can
add as many arguments as you want, just separate them with a comma.
The following example has a function with one argument ($fname). When the
familyName() function is called, we also pass along a name (e.g. Jani), and the
name is used inside the function, which outputs several different first names, but
an equal last name:
Example
<?php
function familyName($fname) {
echo "$fname Refsnes.<br>";
}
familyName("Jani");
familyName("Hege");
familyName("Stale");
?>
The following example shows how to use a default parameter. If we call the
function setHeight() without arguments it takes the default value as argument:
Example
<?php
function setHeight($minheight = 50) {
echo "The height is : $minheight <br>";
}
setHeight(350);
setHeight(); // will use the default value of 50
setHeight(135);
setHeight(80);
?>
o Yii
o Code Igniter
CodeIgniter is an Application Development Framework - a toolkit for people who build web sites using PHP. Its goal is to enable you to
develop projects much faster than you could if you were writing
code from scratch, by providing a rich set of libraries for commonly
needed tasks, as well as a simple interface and logical structure to
access these libraries. CodeIgniter lets you creatively focus on your
project by minimizing the amount of code needed for a given task.
o CakePHP
o PHPDevShell
o Akelos
o Symfony
o Prado
o Zend
o ZooP
Oriented
Php
Framework
(The
Zoop
PHP
o QPHP