Ciao a tutti,

devo recuperare una stringa e suddividerla in linee per poi scriverla in una immagine.

La prima riga deve contare meno caratteri rispetto alle altre. (max 25)
le altre max 30

Esempio:
frase inserita:
QUANDO AL GENERALE CUSTER FU ORDINATO DI ANDARE A LITTLE BIGHORN, LUI FECE L'INDIANO.

Diventerà:
QUANDO AL GENERALE CUSTER
FU ORDINATO DI ANDARE A LITTLE BIGHORN,
LUI FECE L'INDIANO.

Codice che ho utilizzato per lo split del testo a numero univoco per tutte le righe:


codice:
$lines = explode('|', wordwrap($text, 25, '|')); 

foreach ($lines as $line)
 { 
imagettftext($mia_img, $font_size_text, $grades , $x, $y, $font_color, $font_file, $line); 
$y += 65; 
}
Grazie anticipatamente a tutti per l'aiuto.

Ciao e grazie,
Donato