cutting-text-with-explode.php

<?php

$string="Winamp is now freeware! Thanks to all who have previously registered, your support is really appreciated!";

function string_cut($string,$cut_size)
{
  $StringArray=explode(" ",$string);
for($i=0;$i<$cut_size;$i++)
{
$string_cut.=" "."$StringArray[$i]";
}
return "$string_cut"."...";
}
$string="";

echo string_cut($string,8);
?> 
 
info/cutting-text-with-explode.txt · Dernière modification: 2008/11/11 11:37 (modification externe)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki