<?php
function split($stringtosplit)
{
$abc = explode(' ', $stringtosplit);
foreach($abc as $xyz){
echo $stringtosplit;
}
return $abc;
}
?>
function split($stringtosplit)
{
$abc = explode(' ', $stringtosplit);
foreach($abc as $xyz){
echo $stringtosplit;
}
return $abc;
}
?>
for example
<?php
split ('the quick brown fox jumps over the lazy dogs');
?>
split ('the quick brown fox jumps over the lazy dogs');
?>
output : thequickbrownfoxjumpsoverthelazydogs
in this output all the space were removed via explode function, to format this we need to style our string
i.e. echo $stringtosplit .'<br />';
now output will be
the
quick
brown
fox
jumps
over
the
lazy
dogs
No comments:
Post a Comment