SlideShare une entreprise Scribd logo
PHP : Introduction
1. PHP ?
Définition
PHP is a server-side scripting language
designed for web development but also
used as a general-purpose programming
language.
Source : http://en.wikipedia.org
Une histoire du PHP
1994 - Développé par Rasmus Lerdorf
1997 - Re-développement par Andi Gutmans et Zeev Surask
2004 - Introduction de la modélisation objet
2011 - Accélération du processus de livraison de version
81,3 %of all the websites use PHP.
Source : w3tech
Quelques spécificités métiers
Gratuit
-
Une immense communauté
-
Facile à apprendre
-
Très utilisé en France
Quelques spécificités techniques
Multiplate-forme
-
Langage très permissif
-
Langage non compilé
-
Exécution côté serveur
-
Produit du code html
Qui utilise PHP ? (1)
Qui utilise PHP ? (2)
L'écosystème PHP
Salaire du développeur PHP
Source : baromètre AFUP, http://afup.org
2. Un programme PHP
2.1 Outils & configuration
Les outils du développeur PHP (1)
FireFox Chrome Chrome Canary
Les outils du développeur PHP (2)
Sublime Text BracketsAtom.io
Serveur local
MAMP WAMP LAMP
ToDo (1)
Télécharger : WAMP / MAMP / LAMP
Installer : WAMP / MAMP / LAMP
Lancer : WAMP / MAMP / LAMP
Aller à l’url : http://localhost ou http://localhost:8888
ToDo (2)
Créer un dossier « test » dans www ou htdocs
Créer un fichier « index.php » dans test
Dans le fichier index.php, écrire :
<?php echo «hello»; ?>
Aller à l’url : http://localhost/test/index.php
ou http://localhost:8888/test/index.php
2.2 code PHP ?
Un fichier PHP
<?php echo 'Hello world' ; ?>
<?php
echo 'Hello ';
echo 'world';
?>
PHP & HTML
<h1>
<?php echo 'Hello world' ; ?>
</h1>
Commentaires
<?php // echo 'Hello world' ; ?>
3. Valeurs
2.1 Nombres
Définir un nombre
890 // entier
-87 // entier négatif
8.7 // décimal
2.2 Chaînes de caractères
Définir une chaîne de caractères
"When I get sad I stop being sad and be AWESOME instead."
'True story!'
2.3 valeurs spéciales
Booléens
true // vraie
false // faux
Null
La valeur spéciale NULL représente une variable sans
valeur.
3. Opérateurs
3.1 Manipulation
Arithmétique
3 + 2 // 5;
3 - 2 // 1;
3 * 2 // 6;
3 / 2 // 1.5;
3 % 2 // 1;
3 * 2 + 2 // 8;
Concaténation
<?php echo "If you're committed enough, you can make
any story work." . " I once told a woman I was Kevin
Costner, and it worked because I believed it." . " - Saul
Goodman"; ?>
// If you're committed enough, you can make any story
work. I once told a woman I was Kevin Costner, and it
worked because I believed it - Saul Goodman
3.2 Comparaison
Numérique
3 > 2 // true
3 < 2 // false
8 == 9 // false
8 != 9 // true
9 >= 9 // true
9 <= 10 // true
Logique
true && true // true
true && false // false
false && false // false
true || true // true
true || false // true
false || false // false
!true // false
!false // true
3 + 4 == 7 && 2 * 8 > 10 // true
Merci pour votre attention.
Bibliographie
Eloquent JavaScript - Marijn Haverbeke
http://eloquentjavascript.net
Dynamisez vos sites web avec Javascript ! - Johann Pardanaud & Sébastien de la Marck
http://fr.openclassrooms.com/informatique/cours/dynamisez-vos-sites-web-avec-javascript
JavaScript Fundamentals - Jeremy McPeak
http://code.tutsplus.com/courses/javascript-fundamentals
Guide JavaScript - teoli, BenoitL, delislejm, Ame_Nomade, SphinxKnight
https://developer.mozilla.org/fr/docs/Web/JavaScript/Guide
Javascript – MAX_INT: Number Limits - Vjeux
http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html
Lost - Jeffrey Lieber, J. J. Abrams, Damon Lindelof
http://abc.go.com/shows/lost
Crédits (1)
Person of interest - Jonathan Nolan, David Slack, Patrick Harbinson
http://www.cbs.com/shows/person_of_interest/
Halt and Catch Fire - Christopher Cantwell, Christopher C. Rogers
http://www.amctv.com/shows/halt-and-catch-fire
Utilities terminal Icon - kxmylo
http://www.iconarchive.com/show/simple-icons-by-kxmylo/utilities-terminal-icon.html
Breaking bad - Vince Gilligan
http://www.amctv.com/shows/breaking-bad
House of Cards - Beau Willimon
https://www.facebook.com/HouseofCards
The Big Bang Theory - Chuck Lorre, Bill Prady
http://www.cbs.com/shows/big_bang_theory/
Game of Thrones - David Benioff, D. B. Weiss
http://www.hbo.com/game-of-thrones
The Wire - David Simon
http://www.hbo.com/the-wire
Crédits (2)
Silicon Valley - Mike Judge
http://www.hbo.com/silicon-valley
The Killing - Veena Sud
http://www.amctv.com/shows/the-killing
Band of Brothers - Tom Hanks, Steven Spielberg
http://www.hbo.com/band-of-brothers

Contenu connexe

Tendances (17)

ODP
ZendFramework2 - Présentation
julien pauli
 
PDF
PHPTour 2011 - PHP5.4
julien pauli
 
PPTX
PHP Training
ahmed oumezzine
 
ODP
Formation PHP
kemenaran
 
ODP
Migration PHP4-PHP5
julien pauli
 
PDF
Nouveautés php 7
Cyrille Grandval
 
PPTX
Formation php 1
Aymen Drira
 
PPTX
Forma php
Aymen Drira
 
PPTX
Symfony2 - Un Framework PHP 5 Performant
Hugo Hamon
 
PPTX
Langage Perl
Rached Krim
 
PPT
PHP 5.3, PHP Next
SQLI
 
PDF
Php seance1
Imen Arfaoui
 
PPT
Php cours
funinformatique
 
PDF
PHP 7.0 : aperçu des nouveautés
Didcode
 
PDF
Bases de PHP - Partie 1
Régis Lutter
 
PDF
Etes vous-pret pour php8 ?
Christophe Villeneuve
 
PDF
Playing With PHP 5.3
Fabien Potencier
 
ZendFramework2 - Présentation
julien pauli
 
PHPTour 2011 - PHP5.4
julien pauli
 
PHP Training
ahmed oumezzine
 
Formation PHP
kemenaran
 
Migration PHP4-PHP5
julien pauli
 
Nouveautés php 7
Cyrille Grandval
 
Formation php 1
Aymen Drira
 
Forma php
Aymen Drira
 
Symfony2 - Un Framework PHP 5 Performant
Hugo Hamon
 
Langage Perl
Rached Krim
 
PHP 5.3, PHP Next
SQLI
 
Php seance1
Imen Arfaoui
 
Php cours
funinformatique
 
PHP 7.0 : aperçu des nouveautés
Didcode
 
Bases de PHP - Partie 1
Régis Lutter
 
Etes vous-pret pour php8 ?
Christophe Villeneuve
 
Playing With PHP 5.3
Fabien Potencier
 

En vedette (20)

PDF
Startup #7 : how to get customers
Jean Michel
 
PDF
Intégration #1 : introduction
Jean Michel
 
PDF
PHP #2 : variables, conditions & boucles
Jean Michel
 
PDF
Wordpress #3 : content strategie
Jean Michel
 
PDF
Html & Css #6 : formulaires
Jean Michel
 
PDF
Javascript #3 : boucles & conditions
Jean Michel
 
PDF
Javascript #2 : valeurs, types & opérateurs
Jean Michel
 
PDF
Javascript #6 : objets et tableaux
Jean Michel
 
PDF
Une introduction à Javascript
Jean Michel
 
PDF
PHP #6 : mysql
Jean Michel
 
PDF
Javascript #7 : manipuler le dom
Jean Michel
 
PDF
#3 html in the real world
Jean Michel
 
PDF
Architecture logicielle #4 : mvc
Jean Michel
 
PDF
Architecture logicielle #2 : TP timezone
Jean Michel
 
PDF
Html & Css #5 : positionement
Jean Michel
 
PDF
PHP #7 : guess who?
Jean Michel
 
PDF
Javascript #4.2 : fonctions for pgm
Jean Michel
 
PDF
Gestion de projet #4 : spécification
Jean Michel
 
PDF
PHP #4 : sessions & cookies
Jean Michel
 
Startup #7 : how to get customers
Jean Michel
 
Intégration #1 : introduction
Jean Michel
 
PHP #2 : variables, conditions & boucles
Jean Michel
 
Wordpress #3 : content strategie
Jean Michel
 
Html & Css #6 : formulaires
Jean Michel
 
Javascript #3 : boucles & conditions
Jean Michel
 
Javascript #2 : valeurs, types & opérateurs
Jean Michel
 
Javascript #6 : objets et tableaux
Jean Michel
 
Une introduction à Javascript
Jean Michel
 
PHP #6 : mysql
Jean Michel
 
Javascript #7 : manipuler le dom
Jean Michel
 
#3 html in the real world
Jean Michel
 
Architecture logicielle #4 : mvc
Jean Michel
 
Architecture logicielle #2 : TP timezone
Jean Michel
 
Html & Css #5 : positionement
Jean Michel
 
PHP #7 : guess who?
Jean Michel
 
Javascript #4.2 : fonctions for pgm
Jean Michel
 
Gestion de projet #4 : spécification
Jean Michel
 
PHP #4 : sessions & cookies
Jean Michel
 
Publicité

Similaire à PHP #1 : introduction (20)

PPTX
Presentation
bois
 
PDF
Conférence #nwx2014 - Maxime Mauchaussée - Partager du code maintenable et év...
Normandie Web Xperts
 
PDF
Des tests modernes pour Drupal
Christophe Villeneuve
 
PPTX
S2-01-PHP.pptx
kohay75604
 
PDF
Rich Desktop Applications
goldoraf
 
PDF
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
RihabBENLAMINE
 
PDF
PHP mysql Xml.pdf
GroupeExcelMarrakech
 
PDF
Cours 2/3 - Architecture Web
Adyax
 
PDF
Web-DutDst-PHP-DSTTFORMATINCDECKDKD?E.pdf
LuneSabsPericolo1
 
PPT
Mysql
mustaphagren
 
DOC
PHP mysql Xml.doc
GroupeExcelMarrakech
 
PPTX
2013 01-08-php-maturite
Rémi Alvado
 
PDF
php1 cours de vevelepment wep complet pdf
HassanElMoustaoui
 
PDF
Lp web tp3_idse
Karim Amane
 
ODP
Etes vous prêts pour le succes ?
Steven VAN POECK
 
PDF
HTML5... La révolution maintenant!
CARA_Lyon
 
PDF
HTML5... La révolution maintenant!
CARA_Lyon
 
PDF
Utilisation optimale et professionnelle de PHP
Jean-Marc Fontaine
 
PPTX
Javascript as a first programming language : votre IC prête pour la révolution !
VISEO
 
PDF
XebiCon'16 : Choisissez votre style avec Docker & Amazon Web Services Par Al...
Publicis Sapient Engineering
 
Presentation
bois
 
Conférence #nwx2014 - Maxime Mauchaussée - Partager du code maintenable et év...
Normandie Web Xperts
 
Des tests modernes pour Drupal
Christophe Villeneuve
 
S2-01-PHP.pptx
kohay75604
 
Rich Desktop Applications
goldoraf
 
Cours3-PHPfgdwfwdffhddfbwdfwdfwdfwdfwfw.pdf
RihabBENLAMINE
 
PHP mysql Xml.pdf
GroupeExcelMarrakech
 
Cours 2/3 - Architecture Web
Adyax
 
Web-DutDst-PHP-DSTTFORMATINCDECKDKD?E.pdf
LuneSabsPericolo1
 
PHP mysql Xml.doc
GroupeExcelMarrakech
 
2013 01-08-php-maturite
Rémi Alvado
 
php1 cours de vevelepment wep complet pdf
HassanElMoustaoui
 
Lp web tp3_idse
Karim Amane
 
Etes vous prêts pour le succes ?
Steven VAN POECK
 
HTML5... La révolution maintenant!
CARA_Lyon
 
HTML5... La révolution maintenant!
CARA_Lyon
 
Utilisation optimale et professionnelle de PHP
Jean-Marc Fontaine
 
Javascript as a first programming language : votre IC prête pour la révolution !
VISEO
 
XebiCon'16 : Choisissez votre style avec Docker & Amazon Web Services Par Al...
Publicis Sapient Engineering
 
Publicité

Plus de Jean Michel (20)

PDF
Javascript #2.2 : jQuery
Jean Michel
 
PDF
HTML & CSS #10 : Bootstrap
Jean Michel
 
PDF
Javascript #11: Space invader
Jean Michel
 
PDF
Javascript #10 : canvas
Jean Michel
 
PDF
Architecture logicielle #3 : object oriented design
Jean Michel
 
PDF
Architecture logicielle #1 : introduction
Jean Michel
 
PDF
Architecture logicielle #5 : hipsto framework
Jean Michel
 
PDF
Wordpress #2 : customisation
Jean Michel
 
PDF
Wordpress #1 : introduction
Jean Michel
 
PDF
PHP & MYSQL #5 : fonctions
Jean Michel
 
PDF
PHP #3 : tableaux & formulaires
Jean Michel
 
PDF
Dev Web 101 #2 : development for dummies
Jean Michel
 
PDF
Startup #5 : pitch
Jean Michel
 
PDF
WebApp #4 : Consuming REST APIs
Jean Michel
 
PDF
Javascript #8 : événements
Jean Michel
 
PDF
Projet timezone
Jean Michel
 
PDF
WebApp #3 : API
Jean Michel
 
PDF
WebApp #2 : responsive design
Jean Michel
 
PDF
Projet timezone
Jean Michel
 
PDF
WebApp #1 : introduction
Jean Michel
 
Javascript #2.2 : jQuery
Jean Michel
 
HTML & CSS #10 : Bootstrap
Jean Michel
 
Javascript #11: Space invader
Jean Michel
 
Javascript #10 : canvas
Jean Michel
 
Architecture logicielle #3 : object oriented design
Jean Michel
 
Architecture logicielle #1 : introduction
Jean Michel
 
Architecture logicielle #5 : hipsto framework
Jean Michel
 
Wordpress #2 : customisation
Jean Michel
 
Wordpress #1 : introduction
Jean Michel
 
PHP & MYSQL #5 : fonctions
Jean Michel
 
PHP #3 : tableaux & formulaires
Jean Michel
 
Dev Web 101 #2 : development for dummies
Jean Michel
 
Startup #5 : pitch
Jean Michel
 
WebApp #4 : Consuming REST APIs
Jean Michel
 
Javascript #8 : événements
Jean Michel
 
Projet timezone
Jean Michel
 
WebApp #3 : API
Jean Michel
 
WebApp #2 : responsive design
Jean Michel
 
Projet timezone
Jean Michel
 
WebApp #1 : introduction
Jean Michel
 

PHP #1 : introduction

  • 3. Définition PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Source : http://en.wikipedia.org
  • 4. Une histoire du PHP 1994 - Développé par Rasmus Lerdorf 1997 - Re-développement par Andi Gutmans et Zeev Surask 2004 - Introduction de la modélisation objet 2011 - Accélération du processus de livraison de version
  • 5. 81,3 %of all the websites use PHP. Source : w3tech
  • 6. Quelques spécificités métiers Gratuit - Une immense communauté - Facile à apprendre - Très utilisé en France
  • 7. Quelques spécificités techniques Multiplate-forme - Langage très permissif - Langage non compilé - Exécution côté serveur - Produit du code html
  • 11. Salaire du développeur PHP Source : baromètre AFUP, http://afup.org
  • 13. 2.1 Outils & configuration
  • 14. Les outils du développeur PHP (1) FireFox Chrome Chrome Canary
  • 15. Les outils du développeur PHP (2) Sublime Text BracketsAtom.io
  • 17. ToDo (1) Télécharger : WAMP / MAMP / LAMP Installer : WAMP / MAMP / LAMP Lancer : WAMP / MAMP / LAMP Aller à l’url : http://localhost ou http://localhost:8888
  • 18. ToDo (2) Créer un dossier « test » dans www ou htdocs Créer un fichier « index.php » dans test Dans le fichier index.php, écrire : <?php echo «hello»; ?> Aller à l’url : http://localhost/test/index.php ou http://localhost:8888/test/index.php
  • 20. Un fichier PHP <?php echo 'Hello world' ; ?> <?php echo 'Hello '; echo 'world'; ?>
  • 21. PHP & HTML <h1> <?php echo 'Hello world' ; ?> </h1>
  • 22. Commentaires <?php // echo 'Hello world' ; ?>
  • 25. Définir un nombre 890 // entier -87 // entier négatif 8.7 // décimal
  • 26. 2.2 Chaînes de caractères
  • 27. Définir une chaîne de caractères "When I get sad I stop being sad and be AWESOME instead." 'True story!'
  • 30. Null La valeur spéciale NULL représente une variable sans valeur.
  • 33. Arithmétique 3 + 2 // 5; 3 - 2 // 1; 3 * 2 // 6; 3 / 2 // 1.5; 3 % 2 // 1; 3 * 2 + 2 // 8;
  • 34. Concaténation <?php echo "If you're committed enough, you can make any story work." . " I once told a woman I was Kevin Costner, and it worked because I believed it." . " - Saul Goodman"; ?> // If you're committed enough, you can make any story work. I once told a woman I was Kevin Costner, and it worked because I believed it - Saul Goodman
  • 36. Numérique 3 > 2 // true 3 < 2 // false 8 == 9 // false 8 != 9 // true 9 >= 9 // true 9 <= 10 // true
  • 37. Logique true && true // true true && false // false false && false // false true || true // true true || false // true false || false // false !true // false !false // true 3 + 4 == 7 && 2 * 8 > 10 // true
  • 38. Merci pour votre attention.
  • 39. Bibliographie Eloquent JavaScript - Marijn Haverbeke http://eloquentjavascript.net Dynamisez vos sites web avec Javascript ! - Johann Pardanaud & Sébastien de la Marck http://fr.openclassrooms.com/informatique/cours/dynamisez-vos-sites-web-avec-javascript JavaScript Fundamentals - Jeremy McPeak http://code.tutsplus.com/courses/javascript-fundamentals Guide JavaScript - teoli, BenoitL, delislejm, Ame_Nomade, SphinxKnight https://developer.mozilla.org/fr/docs/Web/JavaScript/Guide Javascript – MAX_INT: Number Limits - Vjeux http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html
  • 40. Lost - Jeffrey Lieber, J. J. Abrams, Damon Lindelof http://abc.go.com/shows/lost Crédits (1) Person of interest - Jonathan Nolan, David Slack, Patrick Harbinson http://www.cbs.com/shows/person_of_interest/ Halt and Catch Fire - Christopher Cantwell, Christopher C. Rogers http://www.amctv.com/shows/halt-and-catch-fire Utilities terminal Icon - kxmylo http://www.iconarchive.com/show/simple-icons-by-kxmylo/utilities-terminal-icon.html Breaking bad - Vince Gilligan http://www.amctv.com/shows/breaking-bad House of Cards - Beau Willimon https://www.facebook.com/HouseofCards The Big Bang Theory - Chuck Lorre, Bill Prady http://www.cbs.com/shows/big_bang_theory/ Game of Thrones - David Benioff, D. B. Weiss http://www.hbo.com/game-of-thrones
  • 41. The Wire - David Simon http://www.hbo.com/the-wire Crédits (2) Silicon Valley - Mike Judge http://www.hbo.com/silicon-valley The Killing - Veena Sud http://www.amctv.com/shows/the-killing Band of Brothers - Tom Hanks, Steven Spielberg http://www.hbo.com/band-of-brothers