You need to use count()instead strlen()to get the number of elements in the array.
. FALSE (!$arr), .
():
function implodestr ($arr, $field) {
if (!$arr || !is_array($arr)) return FALSE;
$out = array();
foreach ($arr as $v) if (isset($v[$field])) $out[] = $v[$field];
return ($out) ? implode(',',$out) : FALSE;
}