Bertholt Posted October 1, 2007 Share Posted October 1, 2007 Hy all, I have created a script to display xml press releases but it is no good... The parser i use works perfect, i just need to simplify the code for displaying my release... this is the 'code': <? $XML = new XMLparser; $release = $XML->xml2array("xmlfileurl"); $arReleases = $release[0]['data'][0]['data'][1]['data'][0]['data']; display_xml( $arReleases[2] ); display_xml_home_ned( $arReleases[0] ); display_xml_home_fra( $arReleases[1] ); display_xml( $arReleases[5] ); display_xml_home_ned( $arReleases[4] ); display_xml_home_fra( $arReleases[3] ); display_xml( $arReleases[8] ); display_xml_home_ned( $arReleases[7] ); display_xml_home_fra( $arReleases[6] ); display_xml( $arReleases[11]); display_xml_home_ned( $arReleases[10] ); display_xml_home_fra( $arReleases[9] ); display_xml( $arReleases[14] ); display_xml_home_ned( $arReleases[13] ); display_xml_home_fra( $arReleases[12] ); display_xml( $arReleases[17] ); display_xml_home_ned( $arReleases[16] ); display_xml_home_fra( $arReleases[15] ); display_xml( $arReleases[20] ); display_xml_home_ned( $arReleases[19] ); display_xml_home_fra( $arReleases[18] ); display_xml( $arReleases[23] ); display_xml_home_ned( $arReleases[22] ); display_xml_home_fra( $arReleases[21] ); display_xml( $arReleases[26] ); display_xml_home_ned( $arReleases[25] ); display_xml_home_fra( $arReleases[24] );?> Now you see that there is 1 press release in 3 languages (default is english, then dutch, and then french) Is it possible to generate this bit of code automatically (depending on how much releases there are?) display_xml( $arReleases[2] ); display_xml_home_ned( $arReleases[0] ); display_xml_home_fra( $arReleases[1] ); Or am i doing it totally wrong Kind regards Link to comment https://forums.phpfreaks.com/topic/71350-created-xmlphp-code-works-but-no-good/ Share on other sites More sharing options...
sKunKbad Posted October 1, 2007 Share Posted October 1, 2007 Sorry, but the function display_xml is not in the online manual. That's what I get when I go to php.net Link to comment https://forums.phpfreaks.com/topic/71350-created-xmlphp-code-works-but-no-good/#findComment-359045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.