PHP - Department of Computer Engineering
Download
Report
Transcript PHP - Department of Computer Engineering
Programming Language
Chokechai Chuchokechai 48540439
PHP is a language for creating interactive web sites.
It was originally called "Personal Home Page Tools"
when it was created in 1994 by Rasmus Lerdorf to keep
track of who was looking at his online resume.
Mid-1997: Technion students Andi Gutmans and Zeev
Suraski
redesigned the PHP language engine and wrote some of
the
most popular PHP modules.
At that time PHP already had its own site, php.net,
run by the computer science community, and was
powering
thousands of Web sites. The script was just beginning
to be recognized by developers who preferred the
multi-platform script over its more limited
Microsoft ASP counterpart that interfaces only
with Windows NT.
Today PHP Web developers applaud the script's simplicity,
flexibility, and ability to generate HTML pages quickly.
Over 5,100,000 (1/2001) sites around the world use PHP.
Zeev Suraski, Israel Andi Gutmans, Israel
Shane Caraveo, Florida USA Stig Bakken,
Norway Andrey Zmievski, Nebraska USA
Sascha Schumann, Dortmund, Germany
Thies C. Arntzen, Hamburg, Germany Jim
Winstead, Los Angeles, USA Rasmus Lerdorf,
North Carolina, USA
Less Code, More Function.
It tries to eliminate side effects, which are a
common source of odd behaviour (bugs).
It tries to focus on the intent of a
computation without getting bogged down in
the algorithms.
Webmaster
Web designer
Administer
PHP is a widely-used general-purpose scripting
language that is especially suited for Web
development and can be embedded into HTML.
PHP generally runs on a web server, taking PHP
code as its input and creating Web pages as
output. However, it can also be used for
command-line scripting and client-side GUI
applications. PHP can be deployed on most web
servers and on almost every operating system
and platform free of charge. The PHP Group also
provides the complete source code for users to
build, customize and extend for their own use.
<html>
<head></head>
<body>
<?= "Hello world!" ?><br>
</body>
<?
$x = "Hello ";
$x.= "wrold!";
$x = 10;
$x++;
$x *= 5;
$x = array(1,3,2,4,10);
$x = array(
"a" => "4",
"i" => "1",
"e" => "3",
"later" => "l8r"
);
?>
<?
$x = false;
$x = true;
# boolean
$x = 10;
# decimal
$x = 1.45;
# Floating point
$x = 0x1A;
# hexadecimal
$x = "mmm\"oo'oo\n"; # string = mmm"oo'oo +return in the end of the line
$x = 'mmm"oo\'oo\n'; # string = mmm"oo'oo\n
$y = &$x
# Reference
$x[1] = 10
# array of decimals
$x["name"] = "shlomi"; # associative arrays
$arr[] = "lalala"; # push "lalala"
$x[2]["lala"] = "xx"; # two dimensional
$name = "shlomi";
$animals = array("dog" => "azit" , "cat" => "mitzi");
echo "hello ! My name is $name and my dog's name is ${animals['dog']}";
?>
http://www.haifux.org/lectures/43/slide7.html
http://www.google.com