Convert XML to CSV in PHP

By David Thomas, at 2014-10-06

Output XML string as CSV with first row as column headers......


Latest Tutorials

Sponsored Links
PHP:Convert XML to CSV in PHP.....
PHP:PHP code to write to a CSV fil.....
PHP:PHP code to write to a CSV fil.....
PHP:PHP code to import from CSV fi.....
PHP:Password must include both num.....
Trends:What is Hadoop?.....
WebServices:Returning multiple values from.....
Java:Tomcat and httpd configured in.....
WebServices:Java Webservices using Netbean.....
WebServices:Java WebService connected to D.....
WebServices:How to Deploy a Java Web Servi.....
WebServices:Call a webservice in Java.....
WebServices:Java WebService - Create your .....
WebServices:package javax.jws does not exi.....
Reviews:Nokia Lumia 620 and Samsung AT.....
Reviews:The Twist and Yoga Ultrabooks.....
Android:Getting Started with Android.....
Reviews:Samsung Galaxy S4.....
Reviews:Samsung Galaxy Note 8.0.....

Latest Comments

1. View Comment

Excellent work mate! works like a charm! Lifesaver!

View Tutorial          By: jmcg at 2015-01-29 02:31:56
2. View Comment

My code runs smoothly. I have taken some steps for resolving some earlier problems.
Step 1: By the help Of (

comm.jar should be placed in:



win32com.dll should be placed in:



%windir%System32 should be placed in:



Step 2: Run this program to check Port Detection.
import java.util.Enumeration;
import javax.comm.*;
public class ListPorts
public static void main(String args[]) throws ClassNotFoundException, InstantiationException, IllegalAccessException
CommDriver commDriver = null;
String driverName = "com.sun.comm.Win32Driver"; // or get as a JNLP property
commDriver = (CommDriver) Class.forName(driverName).newInstance();
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier)ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = "Parallel";
case CommPortIdentifier.PORT_SERIAL:
type = "Serial";
default: /// Shouldn't happen
type = "Unknown";
System.out.println(port.getName() + ": " + type);

Step 3: I have paste these four Lines in
CommDriver commDriver = null; // line 1
String driverName = "com.sun.comm.Win32Driver"; // // line 2
commDriver = (CommDriver) Class.forName(driverName).newInstance(); // line 3
commDriver.initialize(); // line 4

try {
// System.out.println(parameters.getPortName());
portId = CommPortIdentifier.getPortIdentifier(parameters.getPortName());

Step 4: Changed The Message Center No. in my case Airtel Rajasthan csca="+919829003333";
Step 5: Then I have faced "Time Out at step two". So I have changed the com port in to Com35. I am using Huawei 3g Dongle.
How to know Com Port- Go to Control Panel->Hardware And Sound->Device Manager->Ports(Com & LPT)
there are two ports were mentioned for Huawei 3g. I firstly used Application Interface But It gives Time Out Error
So I used PC UI Interface(Com35) Then message sent without any problem. Please put These lines in
public static void main(String args[])
SMSClient sms=new SMSClient(1);
sms.sendMessage("+917733853839", "Om");

View Tutorial          By: Amit Shrivastava at 2015-01-25 13:48:46
3. View Comment

how to run this code....... Please tell somebody mail @ (

View Tutorial          By: Honey at 2015-01-24 14:27:38
4. View Comment

i want code to Migration from IPV4 to IPV6 at application level
plz send me.

View Tutorial          By: i want code , can you send me at 2015-01-23 14:38:48
5. View Comment

it really helped me...thank you...

View Tutorial          By: ram at 2015-01-22 20:12:01
6. View Comment

I need one help how to update particular column data only in csv file using android source code

View Tutorial          By: santhosh.s at 2015-01-22 15:09:33
7. View Comment

This has tread error , copy and paster hole code and has that after enter any sentence . out of bounds error thread main thing problem ,

View Tutorial          By: Daniel at 2015-01-21 16:24:36

More Latest News
Most Viewed Articles (in last 30 days)
Most Emailed Articles (in last 30 days)