I have a dropdown list which have some elements.
I want to get all the elements of the dropdown list into a variable of type array.
Any Idea???
User Profile
Collapse
-
Ahmad Nawaz started a topic How to get all elements of a dropdown list into a variable of type array?in PHPHow to get all elements of a dropdown list into a variable of type array?
-
but i want to dynamically enclosed the value of attribute(if exist) in "double quotes".
Because my program will no know the tags of the xml file.\
I have written the following code but its not working properly. if you can correct this then please tell me.
Herer is my code
Code:<?php $xml = new DOMDocument(); $xml->recover = true; $xml->load('test.xml'); $node
Last edited by Dormilich; Dec 25 '10, 10:21 AM. Reason: please use [CODE] [/CODE] tags when posting code -
I have found the code for the above issue.
But now the problem is of attributes.
suppose i have an xml file like the above and the tag have the attribute name = ahmad. the value of the attribute is not enclosed in "double quotes".
Now i want a php program to enclose the value of the attribute "name" in "double quotes".
Any one who can do this???Leave a comment:
-
How to fix errors in XML file using php program?
Code:<?xml version="1.0" encoding="utf-8"?> <note> <to>Tove</to> <from name=ahmad>Jani</from> <heading>Reminder <body>Don't forget me this weekend!</body> </note>
Above is my xml file which contains two errors.
1. the attribute value of from tag in not enclosed in "".
2. heading...Last edited by Dormilich; Dec 25 '10, 10:19 AM. Reason: please use [CODE] [/CODE] tags when posting code
No activity results to display
Show More
Leave a comment: