Display PHP code |
Display PHP code |
David B. |
Sep 19 2008, 03:34 PM
Post
#1
|
Group: Members Posts: 1 Joined: 19-September 08 Member No.: 6,703 |
I need to be able to display some PHP code on a page, without the code executing.
The code tag does not seem adequate. Any advice on how this can be done? Thanks, David Berghouse |
Darin McGrew |
Sep 19 2008, 04:08 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Please see the FAQ entry How can I show HTML examples without them being interpreted as part of my document?
|
Brian Chandler |
Sep 19 2008, 11:13 PM
Post
#3
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
If you have the code you want to show in a string in PHP, just use
echo htmlspecialchars($string); This removes anything that would mess up in html. You don't need to do anything special about "PHP code" as such. |
Lo-Fi Version | Time is now: 24th April 2024 - 12:18 AM |