> Les cours php (crire un texte et images) ! [Ton Webmaster .com]

[ Cours php - crire un texte et afficher une image ]

Ecrire un texte :
On utilise soit la fonction print(""); ou soit echo ""; :

print("Voici mon texte"); // Ceci affichera voici mon texte
echo "Voici mon texte"; // Ceci affichera voici mon texte


Un autre exemple, mais cette fois avec du code HTML :

echo "Bonjour !<br><u>Voici ci-dessous un tableau</u> :<br><table border=\"1\"><tr><td width=\"156\" height=\"24\"><p>Contenu du tableau</p></td></tr></table>";

- Le code ci-dessus affichera donc :

 Bonjour !
Voici ci-dessous un tableau :

Contenu du tableau


Afficher une image :
- Le code ci-dessous affichera une image au format 32x32 pixels ... :

 echo "<img src=\"http://www.mon_site.com/mon_image.gif\" width=\"32\" height=\"32\" border=\"0\" alt=\"Valeur alt\">";


tonwebmaster.com le 1er site de ressource webmaster - forum webmaster

Rechercher sur le site
 
Les liens utiles