function check($v) {
return !(trim($v) == '');
}
while($service = mysql_fetch_assoc($serv)) {
$text = "
1
2
3
4
5
";
function check($v) {
return !(trim($v) == '');
}
$array = array_map('trim', array_filter(explode("\n", $text), 'check'));
echo implode(",", array_slice($array, 0, 3)); // 1,2,3
function($v) {$z = !empty(trim($v)); return $z;}