By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

parsing XML file

P: n/a

i have some problem when i try to print character data emitted by the xml
parser..

$parser = xml_parser_create('');
xml_set_character_data_handler($parser, "characterData");

function characterData($parser, $data)
echo nl2br($data);
this work fine..

but if i try this..
function characterData($parser, $data)
echo nl2br(trim($data));
all line feed are erased and no <br /> is added to the output..

i've tried to change the character encodings with no success..
bye the way i think that the problem is the encoding..

what i can do?
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.