vlauciani's avatar

Lumen - export XML

Hi all

I'm building a simple web service to return XML data from MySQL DB. What is the best way to convert an SQL (or array) output to XML? Is there a package or class that I could include?

Thank you.

0 likes
6 replies
RachidLaasri's avatar

I am not very experienced with Lumen, but i believe you can just add the headers with the response.

....->header('Content-Type', 'application/xml');
vlauciani's avatar

Hi The problem is not the 'Content-Type' but I'd like to know what is the best way to convert an SQL (or array) output to XML. Is there CLASS or METHOD used to do it?

Thank you.

Please or to participate in this conversation.