//ECHO
echo 'mon "nom" est Bribri ';
?>
ou
//GUILLEMETS SIMPLES
echo 'mon \'nom \' est Bribri ';
?>
//GUILLEMETS DOUBLES
echo "mon 'nom' est Bribri ";
?>
ou
//GUILLEMETS DOUBLES ET ANTI-SLASH
echo "mon \"nom \" est Bribri ";
?>
//UNE VARIABLE
$age =17 ;
echo 'le visiteur a' .$age. 'ans';
?>
//PLUSIEURS VARIABLES
$nombre =10 ;
$resultat = ($nombre + 5 ) * $nombre ;
echo "$resultat ans" ;
?>
//UNE CONDITION
$age=8 ;
if ( $age <= 12 )
{
echo " salut " ;
}
?>
$age=8 ;
if ( $age <= 12 )
{
echo "salut" ;
}
else
{
echo "vous Ítes trop vieux
" ;
}
?>
//2 CONDITIONS IMBRIQUEES
$age=8 ;
if ( $age <= 12 )
{
echo "salut
" ;
$autorisation = "oui" ;
}
else
{
echo "vous Ítes trop vieux
" ;
$autorisation = "non" ;
}
echo "Avez-vous l'autorisation d'entrer ? $autorisation " ;
?>
La phrase ci-dessous comporte 20 caractères :
Je suis une phrase !