String breaking function


--------------------------------string breaking function-------------------

$someWords = "Please don't blow me to pieces.";

$wordChunks = explode(" ", $someWords);
for($i = 0; $i < count($wordChunks); $i++){
echo "Piece $i = $wordChunks[$i] <br />";
}

$wordChunksLimited = explode(" ", $someWords, 4);
for($i = 0; $i < count($wordChunksLimited); $i++){
echo "Limited Piece $i = $wordChunksLimited[$i] <br />";
}

Comments

Popular Posta

How to enable .htaccess in wamp server

Web Scraping Amazon with PHP

Disable right click script and Google Instant Map Search