Why are my \n not working in PHP?
- by Strawberry
I'm playing with SAX and noticed it's not line breaking properly. I have no iea why.
function flush_data() {
global $level, $char_data;
$char_data = trim($char_data);
if( strlen( $char_data ) > 0 ) {
print "\n";
$data = split("\n", wordwrap($char_data, 76 - ($level*2)));
foreach($data as $line) {
print str_repeat(' ', ($level +1)) . "[".$line."]"."\n";
}
}
$char_data = '';
}