Skip to content
Advertisement

PHP result usage for new file

I am requesting data from a server using couple of parameters that I take from a CSV file and it works but the output is not user-friendly.

How can I print nicely the result of my PHP response?

This is my script:

JavaScript

And the result of it is the following:

JavaScript

I get what I am asking for but I want to be able to use the output of each result to populate another file or something like that so my final user can just see it nicely. I ran var_dump to debug and the output is this:

JavaScript

How can I use the output?

Advertisement

Answer

Probably you are following the method used in this post.

But you can get the values directly from XML inside the while loop, using the Simple XML object and store the values in an array, you can see more details on how to access node’s values here.

A little short example:

JavaScript

After this, you can generate a CSV file on-the-fly or save it in some place, using the $arr_data values.

I hope it helps in something…

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement