Skip to main content
Known Participant
February 16, 2016
Question

quoting programming language

  • February 16, 2016
  • 1 reply
  • 625 views

Hi,

I want to display php code in my text captions but it is trying to execute the php (I think) when I build to HTML5 and try and start the index.html page. I assume that is the reason because the page won't display unless I take that php code out.

The code is just the following, nothing major

<?php

date_default_timezone_set("Australia/Brisbane");

echo "The time is " . date("h:i:sa");

?>

I just want to quote the code, not execute it.

This topic has been closed for replies.

1 reply

Lilybiri
Legend
February 17, 2016

Just an idea: instead of putting that code as text, make an image from the code?

Known Participant
February 17, 2016

That had crossed my mind, but it is a lot of work for something that I would have thought wouldn't be an issue. I would have thought there was an escape character you could use.

Captiv8r
Legend
February 17, 2016

Just a guess here, but have you tried using something like a backward slash as the escape character?

The only problem with this suggestion is that depending on the code, it may be tricky and take a lot of time to determine exactly where it needs to be placed. And in that case, it's likely easier to do as Lilybiri suggests and simply screen grab an image and use it instead.

Cheers... Rick