ozby Posted November 23, 2008 Share Posted November 23, 2008 Hi, i am developing little bot that reads rss content, but i have a problem; My code is: <?php $contents="http://www.***.com/***/rss?bolumno=101"; $contents = file_get_contents($contents); $parser = xml_parser_create(''); xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, trim($contents), $xml_values); xml_parser_free($parser); echo"<pre>";print_r($xml_values);echo"</pre>"; ?> When i run it on windows(my home pc) there is no problem it works like: [8] => Array ( [tag] => description [type] => complete [level] => 4 [value] => <IMG style="border: navy 1px solid;" src="http://***.com/***/2008/11/23/dixon_k.jpg" border="0" align="left" width="80" height="60"/>The future is all about emotion, says internationally renowned futurist and business consultant Patrick Dixon. That's why business companies need to take into account that money isn't everything, Dixon explains in an interview with Sunday's Zaman. Instead of focusing on profits, he advocates a concept called "Happynomics," whose implications go beyond business, according to the expert. ) but i run it on linux server i lose html tags first and last character (<,>) you can see at below. [8] => Array ( [tag] => description [type] => complete [level] => 4 [value] => IMG style="border: navy 1px solid;" src="http://***.com/***/2008/11/23/dixon_k.jpg" border="0" align="left" width="80" height="60"/The future is all about emotion, says internationally renowned futurist and business consultant Patrick Dixon. That#39;s why business companies need to take into account that money isn#39;t everything, Dixon explains in an interview with Sunday#39;s Zaman. Instead of focusing on profits, he advocates a concept called quot;Happynomics,quot; whose implications go beyond business, according to the expert. ) how can i pass this problem? thank you for help. Link to comment https://forums.phpfreaks.com/topic/133880-xml-parser-strips-html-tags/ Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 I'd say... before you pass $contents to xml_parser, replace all < with < and > with > Maybe'll help Link to comment https://forums.phpfreaks.com/topic/133880-xml-parser-strips-html-tags/#findComment-696947 Share on other sites More sharing options...
ozby Posted November 23, 2008 Author Share Posted November 23, 2008 no. it still dont work. Link to comment https://forums.phpfreaks.com/topic/133880-xml-parser-strips-html-tags/#findComment-696965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.