I have a PHP app, and I want some of the latest data to be extracted and display on a Joomla portal. I just couldn't figure out, can I return an XML document or what is the best way to do?
You can return these information in XML format and for example: snJxml2xslt2joomla You can also return these information in RSS format and use the standard RSS feed module to show it in Joomla!
Or do you want to show some information FROM the Joomla site on an other site?
I'll assume that you want to display the information within a module in Joomla. If that's the case, then you can write your own database connection code (or override Joomla's) and pull the data directly out of the PHP application's database (assuming it's in a database).
If it's not, then there are several RSS/XML parsers within Joomla that will work such as the XML-RPC.
I would suggest to run a cron job to pull a data on regular basis and insert it into your local joomla portal DB. This way you have greater control over what you'd want to do with the data.
This might not be the best solution though. It also greatly depends on the kind of information you'd want to bring across. XML could be a bit more involved in terms of getting the structure right and so on.