La fonction PhP ucfirst()
| Description | La fonction PhP ucfirst() permet de mettre en majuscule la première lettre de la chaîne de caractère appelée (ne prend pas en compte les caractères accentués : é, à, î, ...). | ||
|---|---|---|---|
| Publicité |
|
||
| Solution | $chaine="voici mon texte"; // Appel de la fonction ucfirst() $newchaine=ucfirst($chaine); // Affichage des deux chaînes echo "$chaine<br />devient :<br />$newchaine"; /* voici mon texte devient : Voici mon texte */ ?> |
||
| Notez la solution |
|
||
| Partagez cette question |
|
||
| Questions similaires | La fonction PhP strtolower() La fonction PhP strtoupper() La fonction PhP ucwords() |
||
| Mots clés | ucfirst, php, fonction, majuscule |