Code Comments
Programming Forum and web based access to our favorite programming groups.
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?
Post Follow-up to this messageOn Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote: >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.. But that's what you asked for... read the docs for trim(). -- Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk> <http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Post Follow-up to this messageAndy Hassall wrote: > On Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote: > > > But that's what you asked for... read the docs for trim(). > thanks, resolved.. but by the way trim($string, "\n") don't work fine.. must use trim($string, 10) or trim($string, 0x20)
Post Follow-up to this messageAndy Hassall wrote: > On Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote: > > > But that's what you asked for... read the docs for trim(). > thanks, resolved.. but by the way trim($string, "\n") don't work fine.. must use trim($string, 10) or trim($string, 0x0A)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.