-
Piccoli comandi php
Volevo sapere che comando usare se voglio abbreviare un testo
per es:
prova test prova
voglio ke diventi così
prova te...
_____________________________________________
Un'ultima cosa volevo sapere come si fà a fare diventare un collegamento ipertestuale un semplice link scritto a mano.
Grazie
-
Per l'abbreviazione: ti basta decidere il numero di caratteri che vuoi conservare nel testo (qui te lo scrivo come funzione)
Codice PHP:
function truncate ($string, $chars)
{
return substr ($string, 0, $chars) . '...';
}
I "link scritti a mano"? Cosa sono? Per far stampare a PHP un collegamento basta questo:
Codice PHP:
echo ('<A HREF="new_page.htm">Vai alla nuova pagina!</A>');
Stammi bene...