Grazie Daniel, i cicli sono ostici per me.Originariamente inviato da sir daniel
Codice PHP:
$testo = explode('\n', $testo);
//questo trasforma il testo inserito in 01. riga 1 ecc...
for ($i=0; $i<count($testo); $i++)
{
$testo[$i]="0".$i.". ".$testo[$i];
}
//questo le stampa 1 a 1
for ($i=0; $i<count($testo); $i++)
{
echo $testo[$i];
}
Due domande: partendo da questa stringa
$testo ="# furhf fiuew fniu\n# nfv nviuen vnv iue \n# hfeuwh nv ndfbv dv \n# hfeiowf ncvdncv d";
questo è l'output
00. # furhf fiuew fniu # nfv nviuen vnv iue # hfeuwh nv ndfbv dv # hfeiowf ncvdncv d
Come posso fare per:
1) far partire la numerazione da 01 invece che da 00
2) far sostituire ogni # con i numeri 01, 02, 03