Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:16:52+00:00 2026-06-12T09:16:52+00:00

I am trying to put a XML object into an array but i get

  • 0

I am trying to put a XML object into an array but i get an emty array and i can’t find out why.

<?php

$string = '<?xml version="1.0" encoding="UTF-8"?>
            <confgs>
            # System Settings #
            ############################################################
            ## Login Account Settings

            ADMIN_ID="<confg rang="0" soort="veld" name="config1" />"
            ADMIN_ID="<confg rang="1" soort="veld" name="config2" />"
            ADMIN_PASS="PKXUT1xxRoutIT"
            USER_ID="<confg rang="2" soort="veld" name="config3" />"
            USER_PASS="<confg rang="3" soort="optie" opties="opt1~opt2~opt3" name="config4" />"
            ## Time Adjust Settings
            TIME_ZONE="60"
            DST_ENABLE="Y"
            MAC_ADRES="<confg rang="4" soort="veld" name="config5" />"
            DST_START_MONTH="3"
            DST_START_ORDINAL_DAY="<stconfg rang="1" soort="veld" name="stanconf1" />"
            DST_START_ORDINAL_DAY="<confg rang="8" soort="optie" opties="deze~die~endit~optie~extra" name="kijkhetwerkt" />"
            DST_START_ORDINAL_DAY="5"
            DST_START_ORDINAL_DAY="<stconfg rang="2" soort="veld" name="stanconf2" />"
            DST_START_ORDINAL_DAY="<confg rang="5" soort="veld" name="config6" />"
            DST_START_ORDINAL_DAY="<confg rang="6" soort="optie" opties="dit~dat~bibobla" name="slelect" />"
            IETS_CONF_ORDINAL_CFG="<confg rang="7" soort="veld" name="ditveld" />"
            IETS_CONF_ORDINAL_CFG="<confg rang="9" soort="veld" name="hallo" />"
            </confgs>
          ';

    error_reporting(E_ALL ^ E_NOTICE);
    $dom = new DOMDocument();
    $dom->preserveWhiteSpace = false;
    $dom->loadXML($string);
    $confg = $dom->getElementsByTagName('confg');

    $form = array();
    $a = 0;

    foreach($confg as $configuratie){
        $a++;
        $form[$a] = $dom->saveXML($configuratie);
    }

print_r($form);
    ?>

this is what I get:

Array ( [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => )

something is telling me that my code loops trough all the 10 elements so it has to be there how do i grab it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:16:52+00:00Added an answer on June 12, 2026 at 9:16 am

    That is because the <confg ... /> are now HTML elements and cannot be displayed in browser as they are simply HTML tags.

    If you view source you will see them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to export some portal pages with the theme.In the out put xml
i am trying to parse this xml file into an object to use the
i'm trying to deserialize a Movie object from a German xml string: string inputString
How should I put this XML object into a javascript dictionary? XMLcoming in from
I am trying to import a XML file via API into my php script
I'm trying put an if statement directly into a select field in rails, with
Trying to put a regex expression together that returns the string between _ and
I'm trying to put some custom list adapters into their own classes to make
I'm new to Linq and I'm trying to query a XML document to find
I'm trying to use a mapview object in my app, but I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.