Quantcast
Channel: Can PHP be used inside an XML file? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Simon for Can PHP be used inside an XML file?

$
0
0

All three approaches are technically possible. However, I would not use cron, because it delays the update process of your XML-files after the database content has changed.

You can easily embed PHP-Code in your XML-files, you just have to make sure that the files are interpreted as PHP on the serverside, either by renaming them with a *.php extension or by changing the server directives in the .htaccess-file.

But I think that the best practice here is to generate new XML-files upon updating the database contents. I guess that the XML-files are viewed more often than the database content changes, so this approach reduces the server load.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>