vietboy505
Technical User
I was wondering how I can parse XML using PHP or Perl to output as a nice table & edit later?
If so, how would that work? I am a newbie.
If so, how would that work? I am a newbie.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/local/bin/perl
use XML::Simple;
my $ref = XMLin('foo.xml');
#also with my $ref = XMLin();
use Data::Dumper;
print Dumper($config);
print $config->{logdir};
<config logdir="/var/log/foo/" debugfile="/tmp/foo.debug">
<server name="sahara" osname="solaris" osversion="2.6">
<address>10.0.0.101</address>
<address>10.0.1.101</address>
</server>
<server name="gobi" osname="irix" osversion="6.5">
<address>10.0.0.102</address>
</server>
<server name="kalahari" osname="linux" osversion="2.0.34">
<address>10.0.0.103</address>
<address>10.0.1.103</address>
</server>
</config>
<server>
<server_name>
sahara
</server_name>
<osname>
solaris
</osname>
<osversion>
2.6
</osversion>
<addresses>
<address>
10.0.0.101
</address>
<address>
10.0.1.101
</address>
<addresses>
</server>