Question by Guy: Need help with PHP snippet in HTML file?
I’m trying to put the following code into an HTML file (it must be html for reasons too long to explain). But unfortunately when it hits the > in my code it thinks my php snipped has ended and displays the rest as html.
$ item_array = array(
'title' => $ title,
‘url’ => $ url,
‘description’ => $ description,
‘timestamp’ => $ timestamp
Any ideas how I can parse that => so it still does it’s job in the php snippet without having the HTML think it is an end tag?
Answer by David
if you use the HTML extension, your web service will not know that its php, so it will not compile it.
I tried just echoing “Hello World” but the browser and my web server have no idea how to process this.
Now, if you use php to run the html, it will work just fine, so I dont see a way to do what you want without invoking php.
Add your own answer in the comments!
There are no revisions for this post.