PHP Hypertext Preprocessor Personal Home Page Informaia general

  • Slides: 57
Download presentation
 PHP: Hypertext Preprocessor Personal Home Page

PHP: Hypertext Preprocessor Personal Home Page

Informaţia generală • Este un limbaj de programare dezvoltat pentru crearea scripturilor pentru WEB;

Informaţia generală • Este un limbaj de programare dezvoltat pentru crearea scripturilor pentru WEB; • Apărut în 1995; • Dezvoltat de Rasmus Lerdorf; • Se dezvolă de The PHP Group; • Ultima versiune PHP 5. 3. 7; • 26 octombrie 2011 - PHP 5. 4 beta 2; • Este open-source; Manual în română: • http: //www. php. net/manual/ro/manual. php

PHP este un limbaj de scripting de uz general, cu cod-sursă deschis (open source),

PHP este un limbaj de scripting de uz general, cu cod-sursă deschis (open source), utilizat pe scară largă, și care este potrivit în special pentru dezvoltarea aplicațiilor web și poate fi integrat în documente HTML. • EXEMPLU (exemplu. php): <!DOCTYPE HTML PUBLIC "//W 3 C//DTD HTML 4. 01 Transitional//EN" "http: //www. w 3. org/TR/ht ml 4/loose. dtd"> <html> <head> <title>Exemplu</title> </head> <body> <? php /* comentariu */ echo “Acesta este un script PHP!"; ? > </body> </html>

Diferenţa între PHP şi Java. Script: • Java. Script se execută de partea clientului

Diferenţa între PHP şi Java. Script: • Java. Script se execută de partea clientului (de browser) • Codul PHP este executat pe server, generând HTML care este apoi trimis către client. Clientul va primi rezultatele rulării acelui script, fără a putea cunoaște codulsursă ce stă la bază.

Sintaxa Metoda Începutul Sfîrşitul Scurtă <? ? > XML standard <? php ? >

Sintaxa Metoda Începutul Sfîrşitul Scurtă <? ? > XML standard <? php ? > ASP <% %> SCRIPT <SCRIPT LANGUAGE="php"> </SCRIPT>

Exemple: <? $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; ? > <? php

Exemple: <? $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; ? > <? php $d=date("D"); if ($d=="Fri") { echo "Hello!<br />"; echo "Have a nice weekend!  "; echo "See you on Monday!"; } else echo "Have a nice day!"; ? >

Exemple: <? php $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; elseif ($d=="Sun") echo

Exemple: <? php $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; elseif ($d=="Sun") echo "Have a nice Sunday!"; else echo "Have a nice day!"; ? >

Exemple: <? php switch ($x) { case 1: echo "Number 1"; break; case 2:

Exemple: <? php switch ($x) { case 1: echo "Number 1"; break; case 2: echo "Number 2"; break; case 3: echo "Number 3"; break; default: echo "No number between 1 and 3"; } ? >

Array $cars=array("Saab", "Volvo", "BMW", "Toyota" ); Numeric array $cars[0]="Saab"; $cars[1]="Volvo"; $cars[2]="BMW"; $cars[3]="Toyota";

Array $cars=array("Saab", "Volvo", "BMW", "Toyota" ); Numeric array $cars[0]="Saab"; $cars[1]="Volvo"; $cars[2]="BMW"; $cars[3]="Toyota";

Array <? php $cars[0]="Saab"; $cars[1]="Volvo"; $cars[2]="BMW"; $cars[3]="Toyota"; echo $cars[0]. " and ". $cars[1]. "

Array <? php $cars[0]="Saab"; $cars[1]="Volvo"; $cars[2]="BMW"; $cars[3]="Toyota"; echo $cars[0]. " and ". $cars[1]. " are Swedish cars. "; ? >

Array $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); Associative Arrays $ages['Peter'] = "32"; $ages['Quagmire'] = "30";

Array $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); Associative Arrays $ages['Peter'] = "32"; $ages['Quagmire'] = "30"; $ages['Joe'] = "34";

Array <? php $ages['Peter'] = "32"; $ages['Quagmire'] = "30"; $ages['Joe'] = "34"; echo "Peter

Array <? php $ages['Peter'] = "32"; $ages['Quagmire'] = "30"; $ages['Joe'] = "34"; echo "Peter is ". $ages['Peter']. " years old. "; ? >

Multidimensional Arrays $families = array ( "Griffin"=>array ( "Peter", "Lois", "Megan" ), "Quagmire"=>array (

Multidimensional Arrays $families = array ( "Griffin"=>array ( "Peter", "Lois", "Megan" ), "Quagmire"=>array ( "Glenn" ), "Brown"=>array ( "Cleveland", "Loretta", "Junior" ) );

Multidimensional Arrays Array ( [Griffin] => Array ( [0] => Peter [1] => Lois

Multidimensional Arrays Array ( [Griffin] => Array ( [0] => Peter [1] => Lois [2] => Megan ) [Quagmire] => Array ( [0] => Glenn ) [Brown] => Array ( [0] => Cleveland [1] => Loretta [2] => Junior ) ) echo "Is ". $families['Griffin'][2]. " a part of the Griffin family? ";

Operatori de ciclu <? php $i=1; while($i<=5) { echo "The number is ". $i.

Operatori de ciclu <? php $i=1; while($i<=5) { echo "The number is ". $i. "<br />"; $i++; } ? >

Operatori de ciclu <? php $i=1; do { $i++; echo "The number is ".

Operatori de ciclu <? php $i=1; do { $i++; echo "The number is ". $i. "<br />"; } while ($i<=5); ? >

Operatori de ciclu <? php for ($i=1; $i<=5; $i++) { echo "The number is

Operatori de ciclu <? php for ($i=1; $i<=5; $i++) { echo "The number is ". $i. "<br />"; } ? >

Operatori de ciclu <? php $x=array("one", "two", "three"); foreach ($x as $value) { echo

Operatori de ciclu <? php $x=array("one", "two", "three"); foreach ($x as $value) { echo $value. "<br />"; } ? >

Funcţii <? php function write. Name() { echo “PHP"; } echo “Noi studiem ";

Funcţii <? php function write. Name() { echo “PHP"; } echo “Noi studiem "; write. Name(); ? >

Funcţii <? php function write. Name($fname) { echo $fname. " Popescu. <br />"; }

Funcţii <? php function write. Name($fname) { echo $fname. " Popescu. <br />"; } echo “Numele meu este "; write. Name(“Victor"); echo “Numele soţiei este "; write. Name(“Olga"); echo “Numele fiului este"; write. Name(“Nicolae"); ? >

Funcţii <? php function add($x, $y) { $total=$x+$y; return $total; } echo "1 +

Funcţii <? php function add($x, $y) { $total=$x+$y; return $total; } echo "1 + 16 = ". add(1, 16); ? >

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" />

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html>

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" />

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type=“trimite" /> </form> </body> </html> opitf. php <html> <body> Salut, <? php echo $_POST["fname"]; ? >!<br /> Ai <? php echo $_POST["age"]; ? > ani. </body> </html>

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" />

PHP şi formulare <html> <body> <form action="opitf. php" method="post"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type=“trimite" /> </form> </body> </html> opitf. php <html> <body> Salut, <? php echo $_POST["fname"]; ? >!<br /> Ai <? php echo $_POST["age"]; ? > ani. </body> </html>

PHP şi formulare <form action="welcome. php" method="get"> Nume: <input type="text" name="fname" /> Varsta: <input

PHP şi formulare <form action="welcome. php" method="get"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type="submit" /> </form> http: //localhost/opitf. php? fname=Petru&age=21 opitf. php <html> <body> Salut, <? php echo $_GET["fname"]; ? >!<br /> Ai <? php echo $_GET["age"]; ? > ani. </body> </html>

PHP şi formulare <form action="welcome. php" method="get"> Nume: <input type="text" name="fname" /> Varsta: <input

PHP şi formulare <form action="welcome. php" method="get"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type="submit" /> </form> opitf. php <html> <body> Salut, <? php echo $_GET["fname"]; ? >!<br /> Ai <? php echo $_GET["age"]; ? > ani. </body> </html>

PHP şi formulare Variabila predefinită $_REQUEST Conţine valorile ambelor metode $_GET şi $_POST şi

PHP şi formulare Variabila predefinită $_REQUEST Conţine valorile ambelor metode $_GET şi $_POST şi încă $_COOKIE. <form action="welcome. php" method="***"> Nume: <input type="text" name="fname" /> Varsta: <input type="text" name="age" /> <input type="submit" /> </form> opitf. php <html> <body> Salut, <? php echo $_REQUEST["fname"]; ? > !<br /> Ai <? php echo $_REQUEST["age"]; ? > ani. </body> </html>

PHP XML • Analiza structurii XML se numeşte parsing iar instrumentul pentru analiza dată

PHP XML • Analiza structurii XML se numeşte parsing iar instrumentul pentru analiza dată se numeşte parser. Există două tipuri de XML parseri: • Parser bazat pe arbore (Tree-based parser): Acest parser transformă XML document într-o structură arborescentă. E analizează documentul în întregime şi realizează acces la orice element al documentului ca nodul arborelui (Document Object Model (DOM)) • Parser bazat pe evenimente (Event-based parser): Acest parser percepe documentul XML ca o secvenţă de evenimente. Pentru fiecare eveniment apărut se apelează funcţia pentru tratarea lui.

PHP XML - Expat parser Parserul Expat este partea-componentă a pachetului de bază a

PHP XML - Expat parser Parserul Expat este partea-componentă a pachetului de bază a PHP şi nu necesită instalare suplimentară. Parserul Expat este bazat pe evenimente (event-based parser). Parserul bazat pe evenimente se concentrează pe conţinutul documentului, nu pe structura lui. Din cauza aceasta el este mai rapid decît parserul bazat pe arbore. Exemplu: în fragmentul dat <from>Luchianov Ludmila</from> parserul bazat pe evenimente observă o serie de evenimente: Elementul de start: from Secţia CDATA cu valoarea: Luchianov Ludmila Elementul de închidere: from

PHP XML DOM Parserul DOM este partea-componentă a pachetului de bază a PHP şi

PHP XML DOM Parserul DOM este partea-componentă a pachetului de bază a PHP şi nu necesită instalare suplimentară. Parserul DOM este bazat pe arbore (treebased parser). Parserul bazat pe arbore percepe documentul structurat ca un graf arborescent în care elementele documentului sunt nodurile grafului.

Crearea sructurii (DOMDocument-Object ), încărcarea documentului şi vizualizarea lui <? php $xml. Doc =

Crearea sructurii (DOMDocument-Object ), încărcarea documentului şi vizualizarea lui <? php $xml. Doc = new DOMDocument(); $xml. Doc->load(“books. xml"); print $xml. Doc->save. XML(); ? > P. S. save. XML formează un rînd de text cu documentul XML dat

Rezultat în browser Giada De Laurentiis 2005 30. 00 J K. Rowling 2005 29.

Rezultat în browser Giada De Laurentiis 2005 30. 00 J K. Rowling 2005 29. 99 James Mc. Govern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49. 99 Erik T. Ray 2003 39. 95 Source: <? xml version="1. 0" encoding="ISO-8859 -1"? > <bookstore> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30. 00</price> </book> . . .

Navigarea prin noduri <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $x

Navigarea prin noduri <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $x = $xml. Doc->document. Element; foreach ($x->child. Nodes AS $item) { print $item->node. Name. " = ". $item->node. Value. "<br />"; }

Rezultat • #text = book = Everyday Italian Giada De Laurentiis 2005 30. 00

Rezultat • #text = book = Everyday Italian Giada De Laurentiis 2005 30. 00 #text = book = Harry Potter J K. Rowling 2005 29. 99 #text = book = XQuery Kick Start James Mc. Govern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49. 99 #text = book = Learning XML Erik T. Ray 2003 39. 95 #text =

Navigarea prin noduri <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $x

Navigarea prin noduri <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $x = $xml. Doc->document. Element; foreach ($x->child. Nodes AS $item) { if ($item->node. Name != "#text") print $item->node. Name. " = ". $item->node. Value. "<br />"; }

Rezultat • book = Everyday Italian Giada De Laurentiis 2005 30. 00 book =

Rezultat • book = Everyday Italian Giada De Laurentiis 2005 30. 00 book = Harry Potter J K. Rowling 2005 29. 99 book = XQuery Kick Start James Mc. Govern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49. 99 book = Learning XML Erik T. Ray 2003 39. 95

Exemple <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $book = $xml.

Exemple <? php $xml. Doc = new DOMDocument(); $xml. Doc->load("books. xml"); $book = $xml. Doc->get. Elements. By. Tag. Name('book'); foreach ($book as $elem) { echo "<p>"; echo "Title: "; echo $g=$elem->get. Elements. By. Tag. Name('title')->item(0)->node. Value; echo "<br/>Author: "; echo $g=$elem->get. Elements. By. Tag. Name('author')->item(0)->node. Value; echo "<br/>Year: "; echo $g=$elem->get. Elements. By. Tag. Name('year')->item(0)->node. Value; echo "<br/>Price: "; echo $g=$elem->get. Elements. By. Tag. Name('price')->item(0)->node. Value; echo "</p>"; } ? >

Exemple $nb = $book->length; echo $nb; echo "<p>"; for ($i = 0; $i<$nb; $i++

Exemple $nb = $book->length; echo $nb; echo "<p>"; for ($i = 0; $i<$nb; $i++ ) { $el = $book->item($i); echo "Title: "; echo $g=$el->get. Elements. By. Tag. Name('title')->item(0)->node. Value; echo "<br/>Author: "; echo $g=$el->get. Elements. By. Tag. Name('author')->item(0)->node. Value; echo "<br/>Year: "; echo $g=$el->get. Elements. By. Tag. Name('year')->item(0)->node. Value; echo "<br/>Price: "; echo $g=$el->get. Elements. By. Tag. Name('price')->item(0)->node. Value; echo "</p>"; }

Rezultat Title: Everyday Italian Author: Giada De Laurentiis Year: 2005 Price: 30. 00 Title:

Rezultat Title: Everyday Italian Author: Giada De Laurentiis Year: 2005 Price: 30. 00 Title: Harry Potter Author: J K. Rowling Year: 2005 Price: 29. 99 Title: XQuery Kick Start Author: James Mc. Govern Year: 2003 Price: 49. 99 Title: Learning XML Author: Erik T. Ray Year: 2003 Price: 39. 95

Adăugarea elementelor $ed=array("Springer", "Pandeia", "Litera", "Nova"); echo "<p>"; for ($i = 0; $i<$nb; $i++

Adăugarea elementelor $ed=array("Springer", "Pandeia", "Litera", "Nova"); echo "<p>"; for ($i = 0; $i<$nb; $i++ ) { $el = $book->item($i); $edited = $xml. Doc->create. Element('edited', $ed[$i]); $el->append. Child($edited); echo "Title: "; echo $g=$el->get. Elements. By. Tag. Name('title')->item(0)->node. Value; echo "<br/>Edited: "; echo $g=$el->get. Elements. By. Tag. Name('edited')->item(0)->node. Value; echo "<br/>Author: "; . . . echo "</p>"; }

Rezultat Title: Everyday Italian Edited: Springer Author: Giada De Laurentiis Year: 2005 Price: 30.

Rezultat Title: Everyday Italian Edited: Springer Author: Giada De Laurentiis Year: 2005 Price: 30. 00 Title: Harry Potter Edited: Pandeia Author: J K. Rowling Year: 2005 Price: 29. 99 Title: XQuery Kick Start Edited: Litera Author: James Mc. Govern Year: 2003 Price: 49. 99 Title: Learning XML Edited: Nova Author: Erik T. Ray Year: 2003 Price: 39. 95

PHP Simple. XML este o extensie versiunii 5 PHP şi permite crearea, navigarea şi

PHP Simple. XML este o extensie versiunii 5 PHP şi permite crearea, navigarea şi scimbarea documentelor XML în mod simplu.

Navigarea prin XML cu Simple. XML <? php $xml = simplexml_load_file("books. xml"); echo $xml->get.

Navigarea prin XML cu Simple. XML <? php $xml = simplexml_load_file("books. xml"); echo $xml->get. Name(). "<br />"; foreach($xml->children() as $child) { echo $child->get. Name(). ": ". $child. "<br />"; foreach($child->children() as $ch) { echo $ch->get. Name(). ": ". $ch. "<br />"; } } ? >

Rezultat Bookstore book: title: Everyday Italian author: Giada De Laurentiis year: 2005 price: 30.

Rezultat Bookstore book: title: Everyday Italian author: Giada De Laurentiis year: 2005 price: 30. 00 book: title: Harry Potter author: J K. Rowling year: 2005 price: 29. 99 book: title: XQuery Kick Start author: James Mc. Govern author: Per Bothner author: Kurt Cagle author: James Linn author: Vaidyanathan Nagarajan year: 2003 price: 49. 99 . . .

Obţinerea atributelor <? php $xml = simplexml_load_file("books. xml"); echo $xml->get. Name(). "<br />"; foreach($xml->children()

Obţinerea atributelor <? php $xml = simplexml_load_file("books. xml"); echo $xml->get. Name(). "<br />"; foreach($xml->children() as $child) { $childname=$child->get. Name(); echo $childname. ": ". $child. "<br />"; foreach($child->attributes() as $a => $b) { echo $a, '="', $b, ""</br>"; } foreach($child->children() as $ch) { $cname=$ch->get. Name(); echo $cname. ": ". $ch. "<br />"; } } ? >

Rezultat bookstore book: category="cooking" title: Everyday Italian author: Giada De Laurentiis year: 2005 price:

Rezultat bookstore book: category="cooking" title: Everyday Italian author: Giada De Laurentiis year: 2005 price: 30. 00 . . . book: category="web" title: XQuery Kick Start author: James Mc. Govern author: Per Bothner author: Kurt Cagle author: James Linn author: Vaidyanathan Nagarajan year: 2003 price: 49. 99 book: category="web" cover="paperback" title: Learning XML author: Erik T. Ray year: 2003 price: 39. 95

XPath (XML Path Language) este un limbaj de expresii utilizat pentru a selecta porțiuni

XPath (XML Path Language) este un limbaj de expresii utilizat pentru a selecta porțiuni dintr-un document XML sau pentru a calcula valori (șiruri de caractere, numere, sau valori buleene) pe baza conținutului unui document XML. Versiunea actuală a limbajului este XPath 2. 0, dar cea mai întâlnită versiune în prezent este versiunea 1. 0.

Sintaxa XPath Nodename Selectează toți copii nodului dat / Selectează de la nod rădăcină

Sintaxa XPath Nodename Selectează toți copii nodului dat / Selectează de la nod rădăcină // Selectează nodurile începînd de la nodul curent care corespund condiției . Selectează nodul curent. . Selectează parintele nodului curent @ Selectează atributele

Sintaxa XPath (exemple) bookstore Selectează toți copiii elementului dat /bookstore Selectează elementul bookstore/book Selectează

Sintaxa XPath (exemple) bookstore Selectează toți copiii elementului dat /bookstore Selectează elementul bookstore/book Selectează elemente book copii nodului bookstore //book Selectează toate elementele book din document bookstore//book Selectează toate elementele book care sunt sub elementul bookstore //@lang Selectează toate atributele numite lang

Exemplu cu XPATH <? php // isbn => pages $page_numbers = array( '978 -1594489501'

Exemplu cu XPATH <? php // isbn => pages $page_numbers = array( '978 -1594489501' => '384', // A Thousand Splendid Suns '978 -1594489587' => '352', // The Brief Wondrous Life of Oscar Wao '978 -0545010221' => '784', // Harry Potter and the Deathly Hallows ); $dom = new DOMDocument(); $dom->load('books. xml'); $xpath = new DOMXPath($dom); $books = $xpath->query('book'); foreach($books as $book) { $book->append. Child($dom->create. Element('pages', $page_numbers[$book>get. Attribute('isbn')])); } $dom->save('books 2. xml'); ? >

Rezultat <book isbn="978 -1594489501" category="web"> <title lang="en">XQuery Kick Start</title> <author>James Mc. Govern</author> <author>Per Bothner</author>

Rezultat <book isbn="978 -1594489501" category="web"> <title lang="en">XQuery Kick Start</title> <author>James Mc. Govern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49. 99</price> </book> <book isbn="978 -1594489501" category="web"> <title lang="en">XQuery Kick Start</title> <author>James Mc. Govern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49. 99</price> <pages>384</pages> </book>

<? php function parse_recursive(Simple. XMLElement $element, $level = 0) { $indent = str_repeat("  ",

<? php function parse_recursive(Simple. XMLElement $element, $level = 0) { $indent = str_repeat("  ", $level); // determine how much we'll indent $value = trim((string) $element); // get the value and trim any whitespace from the start and end $attributes = $element->attributes(); // get all attributes $children = $element->children(); // get all children echo "{$indent}Parsing '{$element->get. Name()}'. . . ". "<br/>"; if(count($children) == 0 && !empty($value)) // only show value if there is any and if there aren't any children { echo "{$indent}Value: {$element}". "<br/>"; } if(count($attributes) > 0) {// only show attributes if there any echo $indent. 'Has '. count($attributes). ' attribute(s): '. "<br/>"; foreach($attributes as $attribute) { echo "{$indent}- {$attribute->get. Name()}: {$attribute}". "<br/>"; } } if(count($children)) {// only show children if there any Recursive parsing echo $indent. 'Has '. count($children). ' child(ren): '. "<br/>"; Pentru orice XML foreach($children as $child) { parse_recursive($child, $level+1); // recursion : ) document } } echo $indent. "<br/>"; // just to make it "cleaner" } $xml = new Simple. XMLElement('books. xml', null, true); parse_recursive($xml); ? >

Parsing 'bookstore'. . . Has 4 child(ren): Parsing 'book'. . . Has 1 attribute(s):

Parsing 'bookstore'. . . Has 4 child(ren): Parsing 'book'. . . Has 1 attribute(s): - category: cooking Has 4 child(ren): Parsing 'title'. . . Value: Everyday Italian Has 1 attribute(s): - lang: en Parsing 'author'. . . Value: Giada De Laurentiis Parsing 'year'. . . Value: 2005 Parsing 'price'. . . Value: 30. 00 Parsing 'book'. . . Has 1 attribute(s): - category: children Has 4 child(ren): Parsing 'title'. . . Value: Harry Potter Has 1 attribute(s): - lang: en Parsing 'author'. . . Value: J K. Rowling Rezultat

Concurenţii • Active Server Pages (ASP), corp. Microsoft • Cold. Fusion corp. Allaire.

Concurenţii • Active Server Pages (ASP), corp. Microsoft • Cold. Fusion corp. Allaire.

Avantajele PHP • Viteza. Programele PHPlucrează ma repede decît ASP. • Comoditatea. Programele PHP

Avantajele PHP • Viteza. Programele PHPlucrează ma repede decît ASP. • Comoditatea. Programele PHP pot fi create cît în cadrul documentului HTML aşa şi independent de acesta ce simplifică colaborarea între web-developeri şi webdesigneri. • Preţul. PHP este free software. • Simpltatea utilizării. Progaramatorii cu experienţă în alte limbaje de programare găsesc sintaxa PHP foarte similară cu limbajele date. • PHP este universal. Aceaşi cod PHPpoate fi rulat şi în mediu NTşi pe sisteme din familia UNIX.