I want to echo only 4 word from the sentence i selected from the database example (i am the only at home) if i select it from my database and i echo it i want (i am the only)
to display.
to display.
<? $word = "the man is on the way to is house"; echo "the man is on the way to is house"; //the result is these below //the man is on the way to is house ?>
<? $word = "the man is on the way to is house"; echo "the man is on the way to is house"; //the result is these below //the man is on the way to is house ?>
$word = "the man is on the way to is house";
echo implode(" ", array_slice(explode(" ", $word), 0, 4));
Comment