I need to concatenate an indeterminate number of strings, and I would like a space in between two adjoining strings. Like so a b c d e f.
a b c d e f
Also I do not want
$strings = array( " asd " , NULL, "", " dasd ", "Dasd ", "", "", NULL ); function isValid($v){ return empty($v) || !$v ? false : true; } $concatenated = trim( implode( " ", array_map( "trim", array_filter( $strings, "isValid" ) ) ) ); //"asd dasd Dasd"