function trimlines($s,$t){
$e = explode("\n",$s);
foreach($e as $i => $a){$e[i] = trim($a,$t)}
return implode("\n",$e);
}Optimized-for-speed version:
function trimlines($s,$t){
$e = explode("\n",$s);$z = count($e);
while($z-->0){$e[z] = trim($e[z],$t)}
return implode("\n",$e);
}simple, ain't it?


No comments:
Post a Comment