Estoy buscando una forma de extraer los primeros 100 caracteres de una variable de cadena para poner otra variable para imprimir.
¿Existe alguna función que pueda hacer esto fácilmente?
Por ejemplo:
$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
Llegar:
I am looking for a way to pull the first 100 characters from a string vari