xml while

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Wyciokazz
New php-forum User
New php-forum User
Posts: 7
Joined: Fri Apr 08, 2011 5:53 am

xml while

Postby Wyciokazz » Thu Sep 19, 2013 1:38 pm

Hello i have a script but it show me just same line for while from xml.

XML:

Code: Select all

<server>
<b>
<type>source</type>
<ip>geras2.css.lt</ip>
<c_port>21250</c_port>
<q_port>21250</q_port>
<s_port>0</s_port>
<status>1</status>
<pending>0</pending>
</b>
<o>
<request>sep</request>
<id>2</id>
<zone>1</zone>
<comment/>
<location/>
</o>
<s>
<game>garrysmod</game>
<name>|| Garrysmod.lt || Build server 24/7 |WIRE, PAC3|</name>
<map>gm_flatgrass2</map>
<players>6</players>
<playersmax>10</playersmax>
<password>0</password>
</s>
<e>
<netcode>17</netcode>
<description>Sandbox</description>
<appid>4000</appid>
<bots>0</bots>
<dedicated>d</dedicated>
<os>l</os>
<anticheat>1</anticheat>
<version>13.07.05</version>
<ai_disabled>0</ai_disabled>
<ai_ignoreplayers>0</ai_ignoreplayers>
<coop>0</coop>
<deathmatch>1</deathmatch>
<decalfrequency>10</decalfrequency>
<has_pac3>1</has_pac3>
<has_pac3_editor>1</has_pac3_editor>
<mp_allownpcs>1</mp_allownpcs>
<mp_autocrosshair>1</mp_autocrosshair>
<mp_fadetoblack>0</mp_fadetoblack>
<mp_falldamage>0</mp_falldamage>
<mp_flashlight>1</mp_flashlight>
<mp_footsteps>1</mp_footsteps>
<mp_forcerespawn>1</mp_forcerespawn>
<mp_fraglimit>0</mp_fraglimit>
<mp_friendlyfire>0</mp_friendlyfire>
<mp_teamlist>hgrunt;scientist</mp_teamlist>
<mp_teamplay>0</mp_teamplay>
<mp_timelimit>0</mp_timelimit>
<mp_weaponstay>0</mp_weaponstay>
<nextlevel/>
<physgun_limited>0</physgun_limited>
<r_airboatviewdampendamp>1.0</r_airboatviewdampendamp>
<r_airboatviewdampenfreq>7.0</r_airboatviewdampenfreq>
<r_airboatviewzheight>0.0</r_airboatviewzheight>
<r_jeepviewdampendamp>1.0</r_jeepviewdampendamp>
<r_jeepviewdampenfreq>7.0</r_jeepviewdampenfreq>
<r_jeepviewzheight>10.0</r_jeepviewzheight>
<r_vehicleviewdampen>0</r_vehicleviewdampen>
<sbox_bonemanip_misc>0</sbox_bonemanip_misc>
<sbox_bonemanip_npc>1</sbox_bonemanip_npc>
<sbox_bonemanip_player>0</sbox_bonemanip_player>
<sbox_godmode>1</sbox_godmode>
<sbox_maxballoons>10</sbox_maxballoons>
<sbox_maxbuttons>50</sbox_maxbuttons>
<sbox_maxdoors>5</sbox_maxdoors>
<sbox_maxdynamite>0</sbox_maxdynamite>
<sbox_maxeffects>5</sbox_maxeffects>
<sbox_maxemitters>0</sbox_maxemitters>
<sbox_maxhoverballs>20</sbox_maxhoverballs>
<sbox_maxlamps>0</sbox_maxlamps>
<sbox_maxlights>0</sbox_maxlights>
<sbox_maxnpcs>0</sbox_maxnpcs>
<sbox_maxprops>250</sbox_maxprops>
<sbox_maxragdolls>0</sbox_maxragdolls>
<sbox_maxsents>0</sbox_maxsents>
<sbox_maxspawners>10</sbox_maxspawners>
<sbox_maxthrusters>20</sbox_maxthrusters>
<sbox_maxturrets>5</sbox_maxturrets>
<sbox_maxvehicles>5</sbox_maxvehicles>
<sbox_maxwheels>20</sbox_maxwheels>
<sbox_noclip>1</sbox_noclip>
<sbox_persist/>
<sbox_playershurtplayers>1</sbox_playershurtplayers>
<sbox_weapons>0</sbox_weapons>
<sensor_debugragdoll>0</sensor_debugragdoll>
<sensor_stretchragdoll>0</sensor_stretchragdoll>
<sv_accelerate>10</sv_accelerate>
<sv_airaccelerate>10</sv_airaccelerate>
<sv_allowcslua>0</sv_allowcslua>
<sv_alltalk>0</sv_alltalk>
<sv_bounce>0</sv_bounce>
<sv_cheats>0</sv_cheats>
<sv_contact/>
<sv_footsteps>1</sv_footsteps>
<sv_friction>8</sv_friction>
<sv_gravity>600</sv_gravity>
<sv_hl2mp_item_respawn_time>30</sv_hl2mp_item_respawn_time>
<sv_hl2mp_weapon_respawn_time>20</sv_hl2mp_weapon_respawn_time>
<sv_maxspeed>10000</sv_maxspeed>
<sv_noclipaccelerate>5</sv_noclipaccelerate>
<sv_noclipspeed>5</sv_noclipspeed>
<sv_password>0</sv_password>
<sv_pausable>0</sv_pausable>
<sv_report_client_settings>0</sv_report_client_settings>
<sv_rollangle>0</sv_rollangle>
<sv_rollspeed>200</sv_rollspeed>
<sv_specaccelerate>5</sv_specaccelerate>
<sv_specnoclip>1</sv_specnoclip>
<sv_specspeed>3</sv_specspeed>
<sv_steamgroup/>
<sv_stepsize>18</sv_stepsize>
<sv_stopspeed>10</sv_stopspeed>
<sv_voiceenable>1</sv_voiceenable>
<sv_wateraccelerate>10</sv_wateraccelerate>
<sv_waterfriction>1</sv_waterfriction>
<sv_wire_mapinterface>1</sv_wire_mapinterface>
<toolmode_allow_advdupe2>1</toolmode_allow_advdupe2>
<toolmode_allow_axis>1</toolmode_allow_axis>
<toolmode_allow_axiscentre>1</toolmode_allow_axiscentre>
<toolmode_allow_balloon>1</toolmode_allow_balloon>
<toolmode_allow_ballsocket>1</toolmode_allow_ballsocket>
<toolmode_allow_ballsocketcentre>1</toolmode_allow_ballsocketcentre>
<toolmode_allow_ballsocket_adv>1</toolmode_allow_ballsocket_adv>
<toolmode_allow_button>1</toolmode_allow_button>
<toolmode_allow_camera>1</toolmode_allow_camera>
<toolmode_allow_colmat>1</toolmode_allow_colmat>
<toolmode_allow_colour>1</toolmode_allow_colour>
<toolmode_allow_creator>1</toolmode_allow_creator>
<toolmode_allow_dscale>1</toolmode_allow_dscale>
<toolmode_allow_duplicator>1</toolmode_allow_duplicator>
<toolmode_allow_dynamite>1</toolmode_allow_dynamite>
<toolmode_allow_editentity>1</toolmode_allow_editentity>
<toolmode_allow_elastic>1</toolmode_allow_elastic>
<toolmode_allow_emitter>1</toolmode_allow_emitter>
<toolmode_allow_example>1</toolmode_allow_example>
<toolmode_allow_eyeposer>1</toolmode_allow_eyeposer>
<toolmode_allow_faceposer>1</toolmode_allow_faceposer>
<toolmode_allow_fading_door>1</toolmode_allow_fading_door>
<toolmode_allow_fin2>1</toolmode_allow_fin2>
<toolmode_allow_finger>1</toolmode_allow_finger>
<toolmode_allow_gui_wiring>1</toolmode_allow_gui_wiring>
<toolmode_allow_hoverball>1</toolmode_allow_hoverball>
<toolmode_allow_hydraulic>1</toolmode_allow_hydraulic>
<toolmode_allow_inflator>1</toolmode_allow_inflator>
<toolmode_allow_keypad>1</toolmode_allow_keypad>
<toolmode_allow_keypad_adv>1</toolmode_allow_keypad_adv>
<toolmode_allow_keypad_wire>1</toolmode_allow_keypad_wire>
<toolmode_allow_lamp>1</toolmode_allow_lamp>
<toolmode_allow_leafblower>1</toolmode_allow_leafblower>
<toolmode_allow_light>1</toolmode_allow_light>
<toolmode_allow_makespherical>1</toolmode_allow_makespherical>
<toolmode_allow_material>1</toolmode_allow_material>
<toolmode_allow_motor>1</toolmode_allow_motor>
<toolmode_allow_multi_parent>1</toolmode_allow_multi_parent>
<toolmode_allow_multi_wire>1</toolmode_allow_multi_wire>
<toolmode_allow_muscle>1</toolmode_allow_muscle>
<toolmode_allow_nocollide>1</toolmode_allow_nocollide>
<toolmode_allow_npc_spawnplatform>1</toolmode_allow_npc_spawnplatform>
<toolmode_allow_paint>1</toolmode_allow_paint>
<toolmode_allow_physprop>1</toolmode_allow_physprop>
<toolmode_allow_precision>1</toolmode_allow_precision>
<toolmode_allow_precision_align>1</toolmode_allow_precision_align>
<toolmode_allow_pulley>1</toolmode_allow_pulley>
<toolmode_allow_remover>1</toolmode_allow_remover>
<toolmode_allow_rope>1</toolmode_allow_rope>
<toolmode_allow_rt_antinoclip>1</toolmode_allow_rt_antinoclip>
<toolmode_allow_rt_buoyancy_wire>1</toolmode_allow_rt_buoyancy_wire>
<toolmode_allow_shareprops>1</toolmode_allow_shareprops>
<toolmode_allow_slider>1</toolmode_allow_slider>
<toolmode_allow_stacker>1</toolmode_allow_stacker>
<toolmode_allow_thruster>1</toolmode_allow_thruster>
<toolmode_allow_trails>1</toolmode_allow_trails>
<toolmode_allow_weight>1</toolmode_allow_weight>
<toolmode_allow_weld>1</toolmode_allow_weld>
<toolmode_allow_weld_ez2>1</toolmode_allow_weld_ez2>
<toolmode_allow_wheel>1</toolmode_allow_wheel>
<toolmode_allow_winch>1</toolmode_allow_winch>
<toolmode_allow_wire>1</toolmode_allow_wire>
<toolmode_allow_wireweld>1</toolmode_allow_wireweld>
<toolmode_allow_wire_7seg>1</toolmode_allow_wire_7seg>
<toolmode_allow_wire_addressbus>1</toolmode_allow_wire_addressbus>
<toolmode_allow_wire_adv>1</toolmode_allow_wire_adv>
<toolmode_allow_wire_adv_emarker>1</toolmode_allow_wire_adv_emarker>
<toolmode_allow_wire_adv_hudindicator>1</toolmode_allow_wire_adv_hudindicator>
<toolmode_allow_wire_adv_input>1</toolmode_allow_wire_adv_input>
<toolmode_allow_wire_adv_pod>1</toolmode_allow_wire_adv_pod>
<toolmode_allow_wire_button>1</toolmode_allow_wire_button>
<toolmode_allow_wire_cam>1</toolmode_allow_wire_cam>
<toolmode_allow_wire_cd_disk>1</toolmode_allow_wire_cd_disk>
<toolmode_allow_wire_cd_ray>1</toolmode_allow_wire_cd_ray>
<toolmode_allow_wire_clutch>1</toolmode_allow_wire_clutch>
<toolmode_allow_wire_colorer>1</toolmode_allow_wire_colorer>
<toolmode_allow_wire_consolescreen>1</toolmode_allow_wire_consolescreen>
<toolmode_allow_wire_cpu>1</toolmode_allow_wire_cpu>
<toolmode_allow_wire_damage_detector>1</toolmode_allow_wire_damage_detector>
<toolmode_allow_wire_dataplug>1</toolmode_allow_wire_dataplug>
<toolmode_allow_wire_dataport>1</toolmode_allow_wire_dataport>
<toolmode_allow_wire_datarate>1</toolmode_allow_wire_datarate>
<toolmode_allow_wire_data_satellitedish>1</toolmode_allow_wire_data_satellitedish>
<toolmode_allow_wire_data_store>1</toolmode_allow_wire_data_store>
<toolmode_allow_wire_data_transferer>1</toolmode_allow_wire_data_transferer>
<toolmode_allow_wire_data_wireless_recv>1</toolmode_allow_wire_data_wireless_recv>
<toolmode_allow_wire_data_wireless_srv>1</toolmode_allow_wire_data_wireless_srv>
<toolmode_allow_wire_debugger>1</toolmode_allow_wire_debugger>
<toolmode_allow_wire_detonator>1</toolmode_allow_wire_detonator>
<toolmode_allow_wire_dhdd>1</toolmode_allow_wire_dhdd>
<toolmode_allow_wire_digitalscreen>1</toolmode_allow_wire_digitalscreen>
<toolmode_allow_wire_door>1</toolmode_allow_wire_door>
<toolmode_allow_wire_door_controller>1</toolmode_allow_wire_door_controller>
<toolmode_allow_wire_dual_input>1</toolmode_allow_wire_dual_input>
<toolmode_allow_wire_dupeport>1</toolmode_allow_wire_dupeport>
<toolmode_allow_wire_dynamic_button>1</toolmode_allow_wire_dynamic_button>
<toolmode_allow_wire_dynmemory>1</toolmode_allow_wire_dynmemory>
<toolmode_allow_wire_egp>1</toolmode_allow_wire_egp>
<toolmode_allow_wire_emarker>1</toolmode_allow_wire_emarker>
<toolmode_allow_wire_exit_point>1</toolmode_allow_wire_exit_point>
<toolmode_allow_wire_explosive>1</toolmode_allow_wire_explosive>
<toolmode_allow_wire_expression2>1</toolmode_allow_wire_expression2>
<toolmode_allow_wire_extbus>1</toolmode_allow_wire_extbus>
<toolmode_allow_wire_eyepod>1</toolmode_allow_wire_eyepod>
<toolmode_allow_wire_facer>1</toolmode_allow_wire_facer>
<toolmode_allow_wire_field_device>1</toolmode_allow_wire_field_device>
<toolmode_allow_wire_forcer>1</toolmode_allow_wire_forcer>
<toolmode_allow_wire_freezer>1</toolmode_allow_wire_freezer>
<toolmode_allow_wire_fx_emitter>1</toolmode_allow_wire_fx_emitter>
<toolmode_allow_wire_gates>1</toolmode_allow_wire_gates>
<toolmode_allow_wire_gps>1</toolmode_allow_wire_gps>
<toolmode_allow_wire_gpu>1</toolmode_allow_wire_gpu>
<toolmode_allow_wire_gpulib_switcher>1</toolmode_allow_wire_gpulib_switcher>
<toolmode_allow_wire_grabber>1</toolmode_allow_wire_grabber>
<toolmode_allow_wire_graphics_tablet>1</toolmode_allow_wire_graphics_tablet>
<toolmode_allow_wire_gyroscope>1</toolmode_allow_wire_gyroscope>
<toolmode_allow_wire_hdd>1</toolmode_allow_wire_hdd>
<toolmode_allow_wire_holoemitter>1</toolmode_allow_wire_holoemitter>
<toolmode_allow_wire_hologrid>1</toolmode_allow_wire_hologrid>
<toolmode_allow_wire_hoverball>1</toolmode_allow_wire_hoverball>
<toolmode_allow_wire_hoverdrivecontroller>1</toolmode_allow_wire_hoverdrivecontroller>
<toolmode_allow_wire_hsholoemitter>1</toolmode_allow_wire_hsholoemitter>
<toolmode_allow_wire_hsranger>1</toolmode_allow_wire_hsranger>
<toolmode_allow_wire_hudindicator>1</toolmode_allow_wire_hudindicator>
<toolmode_allow_wire_hydraulic>1</toolmode_allow_wire_hydraulic>
<toolmode_allow_wire_igniter>1</toolmode_allow_wire_igniter>
<toolmode_allow_wire_indicator>1</toolmode_allow_wire_indicator>
<toolmode_allow_wire_input>1</toolmode_allow_wire_input>
<toolmode_allow_wire_keyboard>1</toolmode_allow_wire_keyboard>
<toolmode_allow_wire_keycard>1</toolmode_allow_wire_keycard>
<toolmode_allow_wire_lamp>1</toolmode_allow_wire_lamp>
<toolmode_allow_wire_las_receiver>1</toolmode_allow_wire_las_receiver>
<toolmode_allow_wire_latch>1</toolmode_allow_wire_latch>
<toolmode_allow_wire_light>1</toolmode_allow_wire_light>
<toolmode_allow_wire_locator>1</toolmode_allow_wire_locator>
<toolmode_allow_wire_magnet>1</toolmode_allow_wire_magnet>
<toolmode_allow_wire_materializer>1</toolmode_allow_wire_materializer>
<toolmode_allow_wire_microphone>1</toolmode_allow_wire_microphone>
<toolmode_allow_wire_motor>1</toolmode_allow_wire_motor>
<toolmode_allow_wire_nailer>1</toolmode_allow_wire_nailer>
<toolmode_allow_wire_namer>1</toolmode_allow_wire_namer>
<toolmode_allow_wire_no_collide>1</toolmode_allow_wire_no_collide>
<toolmode_allow_wire_numpad>1</toolmode_allow_wire_numpad>
<toolmode_allow_wire_oscilloscope>1</toolmode_allow_wire_oscilloscope>
<toolmode_allow_wire_output>1</toolmode_allow_wire_output>
<toolmode_allow_wire_painter>1</toolmode_allow_wire_painter>
<toolmode_allow_wire_panel>1</toolmode_allow_wire_panel>
<toolmode_allow_wire_pid>1</toolmode_allow_wire_pid>
<toolmode_allow_wire_pixel>1</toolmode_allow_wire_pixel>
<toolmode_allow_wire_plug>1</toolmode_allow_wire_plug>
<toolmode_allow_wire_pod>1</toolmode_allow_wire_pod>
<toolmode_allow_wire_radio>1</toolmode_allow_wire_radio>
<toolmode_allow_wire_ramcard>1</toolmode_allow_wire_ramcard>
<toolmode_allow_wire_ranger>1</toolmode_allow_wire_ranger>
<toolmode_allow_wire_relay>1</toolmode_allow_wire_relay>
<toolmode_allow_wire_rfid_filter>1</toolmode_allow_wire_rfid_filter>
<toolmode_allow_wire_rfid_implanter>1</toolmode_allow_wire_rfid_implanter>
<toolmode_allow_wire_rfid_reader_act>1</toolmode_allow_wire_rfid_reader_act>
<toolmode_allow_wire_rfid_reader_beam>1</toolmode_allow_wire_rfid_reader_beam>
<toolmode_allow_wire_rfid_reader_prox>1</toolmode_allow_wire_rfid_reader_prox>
<toolmode_allow_wire_rom>1</toolmode_allow_wire_rom>
<toolmode_allow_wire_rtcam>1</toolmode_allow_wire_rtcam>
<toolmode_allow_wire_screen>1</toolmode_allow_wire_screen>
<toolmode_allow_wire_sensor>1</toolmode_allow_wire_sensor>
<toolmode_allow_wire_servo>1</toolmode_allow_wire_servo>
<toolmode_allow_wire_simple_explosive>1</toolmode_allow_wire_simple_explosive>
<toolmode_allow_wire_simple_servo>1</toolmode_allow_wire_simple_servo>
<toolmode_allow_wire_simulate_data>1</toolmode_allow_wire_simulate_data>
<toolmode_allow_wire_soundemitter>1</toolmode_allow_wire_soundemitter>
<toolmode_allow_wire_spawner>1</toolmode_allow_wire_spawner>
<toolmode_allow_wire_speedometer>1</toolmode_allow_wire_speedometer>
<toolmode_allow_wire_spu>1</toolmode_allow_wire_spu>
<toolmode_allow_wire_target_finder>1</toolmode_allow_wire_target_finder>
<toolmode_allow_wire_textreceiver>1</toolmode_allow_wire_textreceiver>
<toolmode_allow_wire_textscreen>1</toolmode_allow_wire_textscreen>
<toolmode_allow_wire_thruster>1</toolmode_allow_wire_thruster>
<toolmode_allow_wire_touchplate>1</toolmode_allow_wire_touchplate>
<toolmode_allow_wire_trail>1</toolmode_allow_wire_trail>
<toolmode_allow_wire_turret>1</toolmode_allow_wire_turret>
<toolmode_allow_wire_twoway_radio>1</toolmode_allow_wire_twoway_radio>
<toolmode_allow_wire_useholoemitter>1</toolmode_allow_wire_useholoemitter>
<toolmode_allow_wire_user>1</toolmode_allow_wire_user>
<toolmode_allow_wire_value>1</toolmode_allow_wire_value>
<toolmode_allow_wire_vehicle>1</toolmode_allow_wire_vehicle>
<toolmode_allow_wire_vthruster>1</toolmode_allow_wire_vthruster>
<toolmode_allow_wire_watersensor>1</toolmode_allow_wire_watersensor>
<toolmode_allow_wire_waypoint>1</toolmode_allow_wire_waypoint>
<toolmode_allow_wire_weight>1</toolmode_allow_wire_weight>
<toolmode_allow_wire_wheel>1</toolmode_allow_wire_wheel>
<toolmode_allow_wire_winch>1</toolmode_allow_wire_winch>
<toolmode_allow_wire_wirelink>1</toolmode_allow_wire_wirelink>
<toolmode_allow_wire_wirer>1</toolmode_allow_wire_wirer>
<toolmode_allow_wire_xyzbeacon>1</toolmode_allow_wire_xyzbeacon>
<toolmode_allow_wnpc>1</toolmode_allow_wnpc>
<tv_enable>0</tv_enable>
<tv_password>0</tv_password>
<tv_relaypassword>0</tv_relaypassword>
<wire_egp_allow_emitter>1</wire_egp_allow_emitter>
<wire_egp_allow_hud>1</wire_egp_allow_hud>
<wire_egp_allow_screen>1</wire_egp_allow_screen>
<wire_egp_max_bytes_per_sec>10000</wire_egp_max_bytes_per_sec>
<wire_egp_max_objects>300</wire_egp_max_objects>
<wire_egp_max_poly_vertices>1024</wire_egp_max_poly_vertices>
<wire_expression2_cameras_max>5</wire_expression2_cameras_max>
<wire_expression2_find_max>10</wire_expression2_find_max>
<wire_expression2_find_rate>0.050000</wire_expression2_find_rate>
<wire_expression2_lights_max>20</wire_expression2_lights_max>
<wire_holoemitter_interval>0.300000</wire_holoemitter_interval>
<wire_hoverdrive_cooldown>2</wire_hoverdrive_cooldown>
<_feed_>http://garrysmod.lt</_feed_>
</e>
<p>
<player>
<pid>0</pid>
<name>علي احمد</name>
<score>0</score>
<time>02:18:21</time>
</player>
<player>
<pid>0</pid>
<name>Lamacik</name>
<score>0</score>
<time>01:42:54</time>
</player>
<player>
<pid>0</pid>
<name>jdhr24</name>
<score>0</score>
<time>01:12:00</time>
</player>
<player>
<pid>0</pid>
<name>AboveVonDoom</name>
<score>0</score>
<time>00:39:03</time>
</player>
<player>
<pid>0</pid>
<name>5173N43</name>
<score>0</score>
<time>00:03:26</time>
</player>
<player>
<pid>0</pid>
<name>Lauryzz</name>
<score>0</score>
<time>00:36:36</time>
</player>
</p>
</server>


PHP:

Code: Select all

<?php
$fp = fopen("http://garrysmod.lt/sb/includes/lgsl/lgsl_files/lgsl_feed.php?type=source&ip=geras2.css.lt&c_port=21250&q_port=21250&request=sep&xml=1","r")
         or die("Error reading Icecast data from $server.");

while(!feof($fp))
{
     $data .= fread($fp, 8192);
}

fclose($fp);
$vals = '';
// Now parse the XML output for our mountpoint
$xml_parser = xml_parser_create();
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);

$params = array();
$level = array();
foreach ($vals as $xml_elem) {
     if ($xml_elem['type'] == 'open') {
        if (array_key_exists('attributes',$xml_elem)) {
                  list($level[$xml_elem['level']],$extra) =
array_values($xml_elem['attributes']);
         } else {
             $level[$xml_elem['level']] = $xml_elem['tag'];
         }
     }
     if ($xml_elem['type'] == 'complete') {
         $start_level = 1;
         $php_stmt = '$params';
         while($start_level < $xml_elem['level']) {
             $php_stmt .= '[$level['.$start_level.']]';
             $start_level++;
         }
         $php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];';
         eval($php_stmt);
     }
}

$ip = $params['SERVER']['B']['IP'];
$port = $params['SERVER']['B']['C_PORT'];
$mapas = $params['SERVER']['S']['MAP'];
$max = $params['SERVER']['S']['PLAYERSMAX'];
$players = $params['SERVER']['S']['PLAYERS'];
if (file_exists('http://garrysmod.lt/sb/includes/lgsl/lgsl_files/maps/source/garrysmod/'.$mapas.'.png')) {
    $map = '<img alt="" src="http://garrysmod.lt/sb/includes/lgsl/lgsl_files/maps/source/garrysmod/'.$mapas.'.png" title="Spausk kad peržiurėtum serverio informacija" style="border:none; vertical-align:middle">';
} else {
    $map = '<img alt="" src="http://garrysmod.lt/sb/includes/lgsl/lgsl_files/other/map_no_image.jpg" title="Spausk kad peržiurėtum serverio informacija" style="border:none; vertical-align:middle">';           
}

$server = "";

$server .= '<div id="latest_project">
            <div class="image_frame_01">
                '.$map.'
                <span></span>
            </div>
           
            <div id="latest_project_content">
                <div class="header_01">'. $ip .':'. $port .'</div>
<tr>
            <td style="padding:0px; border:1px solid">
              <div style="left:0px; right:0px; top:0px; bottom:0px; width:200px; height:90px; overflow:auto; text-align:left">
                <span style="padding:1px; float:left"> Žaidėjai: </span>
                <span style="padding:1px; float:right"> '.$players.' / '.$max.' </span>
                <br />
                <br />
<div style="left:0px; right:0px; top:0px; bottom:0px; padding:1px; white-space:nowrap; overflow:hidden; text-align:left" title="">  </div>            ';

    $i=0;
    while($i!=$players) {
   $server .=  '                  <div style="left:0px; right:0px; top:0px; bottom:0px; padding:1px; white-space:nowrap; overflow:hidden; text-align:left" title="5173N43">'.$params['SERVER']['P']['PLAYER']['NAME'].' </div>';
        $i++;
    }

$server .= '         </div>
            </td>
          </tr>

      <br />
        <div class="rc_btn_01"><a href="#">'.$mapas.'</a></div>
         </div>
                       
            <div class="cleaner"></div>
      </div>';
?>

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: xml while

Postby johnj » Fri Sep 20, 2013 4:28 am

please print $data and verify if it is picking all the data lines from the xml file.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests

cron