Jump to content

How to store each line of XML into a php array


chaithu7844

Recommended Posts

I have a XML file in the following format

 

<?xml version="1.0" encoding="utf-8"?>

<services>

<service id="14" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_S" Libelle="Accès aux soins" ></service>

<service id="17" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_B" Libelle="Accompagnement scolaire" ></service>

<service id="9" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_J" Libelle="Accueil de jour" ></service>

<service id="15" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_T" Libelle="Accueil téléphonique" ></service>

<service id="1" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_A" Libelle="Accueil-Orientation" ></service>

<service id="6" logo="http://www.quiaccueillequi.org/webservices/logos/6.png" colonne="Acti_G" Libelle="Aide au logement" ></service>

<service id="8" logo="http://www.quiaccueillequi.org/webservices/logos/8.png" colonne="Acti_I" Libelle="Alphabétisation / FLE" ></service>

<service id="2" logo="http://www.quiaccueillequi.org/webservices/logos/2.png" colonne="Acti_C" Libelle="Domiciliation" ></service>

<service id="3" logo="http://www.quiaccueillequi.org/webservices/logos/3.png" colonne="Acti_D" Libelle="Douche" ></service>

<service id="4" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_E" Libelle="Emploi" ></service>

<service id="5" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_F" Libelle="Formalités" ></service>

<service id="19" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_K" Libelle="Formation" ></service>

<service id="7" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_H" Libelle="Hébergement" ></service>

<service id="10" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_M" Libelle="Hébergement avec enfant" ></service>

<service id="11" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_N" Libelle="Nourriture" ></service>

<service id="12" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_P" Libelle="Prévention Santé" ></service>

<service id="13" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_R" Libelle="Réinsertion" ></service>

<service id="16" logo="http://www.quiaccueillequi.org/webservices/logos/defaut.png" colonne="Acti_V" Libelle="Vestiaire" ></service>

</services>

 

 

----------------------------------

 

I WANT TO STORE EACH LINE IN A ARRAY, THE MAIN DIFFICULTY HERE IS I WANT TO STORE EACH LINE AS A STRING AND OUTPUT THE VALUE AS A STRING, WHICH WHEN I STORE I AM NOT GETTING ANY OUTPUT AFTER STORING THE VALUE INTO A VARIBALE AND GIVING ECHO.

COULD U HELP ME OUT HOW TO STORE EACH LINE AS A STRING IN A ARRAY

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.