- var_dump: documentation ( source)
- implode: documentation ( source)
- str_replace: documentation ( source)
<?php
foreach ( [ false, null, [], '', '0', '0.0' ] as $value ) {
$value = str_replace( ' ', "\n", $value );
if ( is_array( $value ) ) {
$value = implode( "\n", $value );
}
var_dump( $value );
}