Jump to content

dragunov

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dragunov's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. HEy Guys Here is a snippet of an array: SimpleXMLElement Object ( [report1] => SimpleXMLElement Object ( [ReportHost] => Array ( [0] => SimpleXMLElement Object ( [HostName] => 192.168.2.34 [startTime] => Thu Dec 17 13:58:49 2009 [stopTime] => Thu Dec 17 15:13:13 2009 [netbios_name] => (unknown) [mac_addr] => (unknown) [dns_name] => (unknown) [os_name] => (unknown) [num_ports] => 2 [num_lo] => 0 [num_med] => 0 [num_hi] => 0 [ReportItem] => Array which is printed using print_r($a) now how can i access [HostName] => 192.168.2.34 in the $a array?? Thanks in advance
  2. Hi Guys I am parsing xml using. I need to know if I can associate character data with tags while parsing character data. For example I have the following xml:-- <tag1>tag1 character data</tag1> <tag2>tag2 character data</tag2> Now, is there a way I can associate "tag1 character data" with <tag1> and "tag2 character data" with <tag2> while parsing php. Thanks in advance!!
  3. Hi guys I am new to this forum and a complete newb to php. I was wandering if I can get some help with XML parsing using php. The XML snippet is as follows:-- <some-xml1> <some-xml2> </some-xml2> <ReportHost> <HostName>192.168.2.34</HostName> <startTime>Thu Dec 17 13:58:49 2007</startTime> <stopTime>Thu Dec 17 15:13:13 2007</stopTime> <netbios_name>(unknown)</netbios_name> <mac_addr>(unknown)</mac_addr> <dns_name>(unknown)</dns_name> <os_name>(unknown)</os_name> <num_ports>2</num_ports> <num_lo>0</num_lo> <num_med>0</num_med> <num_hi>0</num_hi> <ReportItem> <port>http (80/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>telnet (23/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>http (80/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> <ReportItem> <port>telnet (23/tcp)</port> <severity>0</severity> <pluginID>0</pluginID> <pluginName></pluginName> <data>PORT</data> </ReportItem> </ReportHost> <some-xml3> </some-xml3> </some-xml1> There are <reporthost> tags for one host and within that tag are <reportitem> tags for every item on that host. Now I need a way to extract hostnames from every <reporthost> and associate all the <pluginname> with that particular host. Any help will be appreciated. Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.