atelier

PHP

parcours pratique pour apprendre PHP depuis zero

definition d abord

ce que signifie PHP

PHP sert a ecrire des instructions precises. Ici tu l abordes comme parcours pratique pour apprendre PHP depuis zero. Commence par une idee simple: des entrees passent par des etapes et deviennent une sortie.

infos minimalesfichier index.phpexecuter php index.phphabitude apprends une petite piece de PHP, tape un exemple minimal et execute-le
programme

une suite d instructions executees dans un ordre clair.

valeur et variable

une valeur est une donnee. Une variable est le nom qui la garde.

fonction

un petit travail nomme qui recoit une entree et produit un resultat.

environnement

PHP CLI or web server execute le code de index.php.

premier code lisible

Variables

dollar variables echo arrays
<?php
$name = "Ada";
echo $name;
sortie Ada

lignee du langage

arbre de PHP

vois d ou vient PHP, quels langages sont proches, et quoi apprendre ensuite.

racines
CPerlCGI
actuelPHPfamille web et interface
famillefamille web et interface
utile pour

utile pour parcours pratique pour apprendre PHP depuis zero

parcours debutant

1lire une regle2prevoir la sortie3taper de memoire4lancer la verification5recommencer avec un changement

Banque de questions

Chercher puis pratiquer

Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.

18 resultats
Q 1ChoixEtape 1 definitions

PHP question 1

PHP question 1. Choisis l explication qui correspond le mieux a variable.

Q 2ChoixEtape 1 definitions

PHP question 2

PHP question 2. Choisis l explication qui correspond le mieux a echo.

Q 3ChoixEtape 1 definitions

PHP question 3

PHP question 3. Choisis l explication qui correspond le mieux a function.

Q 4ChoixEtape 1 definitions

PHP question 4

PHP question 4. Choisis l explication qui correspond le mieux a foreach.

Q 5ChoixEtape 1 definitions

PHP question 5

PHP question 5. Choisis l explication qui correspond le mieux a variable.

Q 6ChoixEtape 1 definitions

PHP question 6

PHP question 6. Choisis l explication qui correspond le mieux a echo.

Q 7ChoixEtape 1 definitions

PHP question 7

PHP question 7. Choisis l explication qui correspond le mieux a function.

Q 8ChoixEtape 1 definitions

PHP question 8

PHP question 8. Choisis l explication qui correspond le mieux a foreach.

Q 9ChoixEtape 1 definitions

PHP question 9

PHP question 9. Choisis l explication qui correspond le mieux a variable.

Q 10ChoixEtape 1 definitions

PHP question 10

PHP question 10. Choisis l explication qui correspond le mieux a echo.

Q 11ChoixEtape 1 definitions

PHP question 11

PHP question 11. Choisis l explication qui correspond le mieux a function.

Q 12ChoixEtape 1 definitions

PHP question 12

PHP question 12. Choisis l explication qui correspond le mieux a foreach.

Q 13ChoixEtape 1 definitions

PHP question 13

PHP question 13. Choisis l explication qui correspond le mieux a variable.

Q 14ChoixEtape 1 definitions

PHP question 14

PHP question 14. Choisis l explication qui correspond le mieux a echo.

Q 15ChoixEtape 1 definitions

PHP question 15

PHP question 15. Choisis l explication qui correspond le mieux a function.

Q 16ChoixEtape 1 definitions

PHP question 16

PHP question 16. Choisis l explication qui correspond le mieux a foreach.

Q 17ChoixEtape 1 definitions

PHP question 17

PHP question 17. Choisis l explication qui correspond le mieux a variable.

Q 18ChoixEtape 1 definitions

PHP question 18

PHP question 18. Choisis l explication qui correspond le mieux a echo.

choix multiple

PHP question 1

Q 1Choixnouveau

PHP question 1. Choisis l explication qui correspond le mieux a variable.

$name = "Ada";

reference

modeles pour index.php

PHP CLI or web serverphp index.php
rappel de memoirelis un point puis recris le sans regarder
suivre le codenote les valeurs ligne par ligne avant d executer
taper soi memecopie moins tape plus et corrige un petit bug

dollar variables echo arrays

Variables

<?php
$name = "Ada";
echo $name;
  • Variables start with dollar sign
  • echo outputs text
  • End statements with semicolons

function parameters return

fonctions

function add($a, $b) {
  return $a + $b;
}
  • Use function for reusable work
  • Validate input
  • Return values

indexed associative foreach

Arrays

$user = ["name" => "Ada"];
echo $user["name"];
  • Associative arrays use keys
  • foreach loops through arrays
  • Escape output in HTML