Je cherche un moyen d'extraire les 100 premiers caractères d'une variable de chaîne pour les mettre dans une autre variable pour l'impression.
Y a-t-il une fonction qui peut faire cela facilement?
Par exemple:
$string1 = "I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.";
$string2 = 100charfunction($string1);
print $string2
Obtenir:
I am looking for a way to pull the first 100 characters from a string vari