A voir également:
- Chaine de caracteres en PHP
- Caractères ascii - Guide
- Caractères spéciaux - Guide
- Chaine tnt gratuite sur mobile - Guide
- Plus de chaine tv - Guide
- Chaine radio - Télécharger - Médias et Actualité
4 réponses
Essaie avec la fonction substr(chaine,n,m) qui retourne la sous-chaine commençant à la n-ième position et de longueur m ( pour le premier caractère n = 0 ).
print(substr("abcdef",4,1) );
-> e
print(substr("abcdef",4,1) );
-> e
Plus simplement (pour un caracatère)
johand@zoot:/tmp$ php4
<?
$st="123ab";
echo $st[3];
?>
X-Powered-By: PHP/4.1.2
Content-type: text/html
ajohand@zoot:/tmp$
Gates gave us the windows.
Linux gave us the whole house....
johand@zoot:/tmp$ php4
<?
$st="123ab";
echo $st[3];
?>
X-Powered-By: PHP/4.1.2
Content-type: text/html
ajohand@zoot:/tmp$
Gates gave us the windows.
Linux gave us the whole house....