Posted by yawnmoth on 11/18/12 11:42
Say I have the following script:
<?php
$contents="<p>test\ntest</p>";
$xml_parser = xml_parser_create('UTF-8'); // try xml_parser_create_ns,
too.
xml_set_character_data_handler($xml_parser,'handler');
xml_parse($xml_parser, $contents);
function handler($parser, $data)
{
static $count=1;
echo "$count. $data<br />";
$count++;
}
?>
When ran on PHP4 (via the web, so new lines are seen as spaces) I get
this:
1. test
2.
3. test
When ran on PHP5 (via the web) I get this:
1. test test
Why the difference? Is there any way to get PHP5 to simulate PHP4's
behavior?
[Back to original message]
|