Reputation: 11
I create code for the divide the paragraph of string by " ". but now i want to divide the paragraph or string by number of character.
<?php
$pizaa="this is my line"
$pieces = explode(" ", $pizza);
echo $pieces;
?>
In above code how to divide this line by number of character.not using wordwrap()
.
only using the explode()
.
Upvotes: 0
Views: 69
Reputation: 12042
use str_split()
to explode by number of character.
<?php
$pizaa="this is my line";
$pieces = str_split($pizaa);
var_dump($pieces);
?>
Upvotes: 1