PHP is often described as a templating language where HTML sections and script are mixed to generate HTML documents for rendering in a browser. As the web technology is advancing PHP is used to generate other types of content (JSON, see chapter 14; and images see chapter 8, etc.) and the PHP scripts contain less embedded HTML sections. Instead the script will read a template from disk or a database and perform string replacements on the content before sending it to the client.
Simple string replacements can be done with the str_replace() function , but this function will replace a ...