PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have this dropdown which pulls fields from the xml file and displays the names .
The list is not alphabetically sorted and I wanted to know how i could do that.
I'm sure there's probably a better / easier way, but the first thing that came to mind was to load the values into an array, sort the array, then print the output.
smilesmita wrote:doesnt work..its giving nothing in the drop down box..?
How about doing some troubleshooting to see where it's fouling up? I've only seen 8 lines of your code. The code I wrote was an example to inspire you to write your own working solution.
Try dumping the contents of $attribs:
var_dump($attribs);
Is it getting populated from the while loop?
Is the code outputting any <option> tags in your HTML?