comment insérer une variable php dans du html

Par SPF, il y a 8 ans


Bonjour,

Voila mon code :

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!--commentaire html-->
<?php

echo "Hello World"; // echo ou print; des “ ou ‘; un point ; à la fin attention !
//commentaire php

?>

</body>
</html>

J'aimerais créer deux variables une a 2 et l'autre a 4 ,si vous pouviez m'expliquer et m'aider sa serais cool merci
Niveau : Extremement Novice

2 réponses

Laznet, il y a 8 ans

Bonjour

Pourrais-tu être plus précis

J'aimerais créer deux variables une a 2 et l'autre a 4

Baw0u, il y a 8 ans
<?php $two = 2; $four = 4; echo $two; //Affiche 2 echo $four; //Affiche 4 echo $two+$four; //Affiche 6 ?>