explode()

  1. Eliox

    creare un'introduzione da un testo

    Funzioncina per creare un'introduzione da un testo: <? function intro($testo, $lung_max, $finale) { return (count($str = explode(' ', $testo)) > $lung_max) ?implode(' ', array_slice($str, 0, $lung_max)) . $finale : $testo; } //per cui: $testo = "Testo testo testo...