une suite d instructions executees dans un ordre clair.
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.
index.phpexecuter php index.phphabitude apprends une petite piece de PHP, tape un exemple minimal et execute-leune valeur est une donnee. Une variable est le nom qui la garde.
un petit travail nomme qui recoit une entree et produit un resultat.
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 Adalignee du langage
arbre de PHP
vois d ou vient PHP, quels langages sont proches, et quoi apprendre ensuite.
utile pour parcours pratique pour apprendre PHP depuis zero
parcours debutant
Banque de questions
Chercher puis pratiquer
Choisis une etape ou cherche dans la banque de ce langage puis ouvre l exercice.
PHP question 1
PHP question 1. Choisis l explication qui correspond le mieux a variable.
PHP question 2
PHP question 2. Choisis l explication qui correspond le mieux a echo.
PHP question 3
PHP question 3. Choisis l explication qui correspond le mieux a function.
PHP question 4
PHP question 4. Choisis l explication qui correspond le mieux a foreach.
PHP question 5
PHP question 5. Choisis l explication qui correspond le mieux a variable.
PHP question 6
PHP question 6. Choisis l explication qui correspond le mieux a echo.
PHP question 7
PHP question 7. Choisis l explication qui correspond le mieux a function.
PHP question 8
PHP question 8. Choisis l explication qui correspond le mieux a foreach.
PHP question 9
PHP question 9. Choisis l explication qui correspond le mieux a variable.
PHP question 10
PHP question 10. Choisis l explication qui correspond le mieux a echo.
PHP question 11
PHP question 11. Choisis l explication qui correspond le mieux a function.
PHP question 12
PHP question 12. Choisis l explication qui correspond le mieux a foreach.
PHP question 13
PHP question 13. Choisis l explication qui correspond le mieux a variable.
PHP question 14
PHP question 14. Choisis l explication qui correspond le mieux a echo.
PHP question 15
PHP question 15. Choisis l explication qui correspond le mieux a function.
PHP question 16
PHP question 16. Choisis l explication qui correspond le mieux a foreach.
PHP question 17
PHP question 17. Choisis l explication qui correspond le mieux a variable.
PHP question 18
PHP question 18. Choisis l explication qui correspond le mieux a echo.
choix multiple
PHP question 1
PHP question 1. Choisis l explication qui correspond le mieux a variable.
$name = "Ada";
reference
modeles pour index.php
php index.phpdollar 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