I have been thinking about this.
I am aware you can use json_encode(); to send an encoded array or multi-dimensional array via the jquery ajax call which will interpret the json array for you.
However I am not aware of any other techniques to send more than just a string using echo, print or return from PHP to the jQuery script?
Can someone please enlighten me on this?
Thanks,
Stefan
At the end of the day, you will only be sending a string back to an AJAX request. How you interpret that string in the JavaScript is the part that will affect what you are doing.
For instance, you can return XML, JSON, plain text, HTML. You can return a CSV file, and parse it in JS. You could even return Markdown if you wanted, then process it with Showdown.
However, you are only processing strings, not other forms of data. Whatever you can accept and process with JS you can send to an AJAX request as a string.