Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How to cite php code in articles

Asked Modified Viewed 3,166 times
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
asked
Veteran Member

I'm trying to cite php code [as in examples of code, not to execute it] in articles and I've tried...

//echo "<td width='50%' class='tbl'....

and even

//ech0 "<td width='50%' class='tbl'....

but it even recognises the html. Is there any of getting around this?
0 replies

5 posts

K
Kenneth
K
/Kenneth
  • Junior Member, joined since
  • Contributed 23 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

try putting the code in <code></code> tags... should work... Not sure though...

Edit: Nevermind... Doesn't work...
Edited by Kenneth on 11-07-2008 00:34,
0 replies
K
Kenneth
K
/Kenneth
  • Junior Member, joined since
  • Contributed 23 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

<xmp></xmp> tags works though.
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

Thanx K,
xmp almost works. However, it still adds <br>'s when there weren't any before and the code text doesn't wrap.
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

The only thing so far that works is changing the opening brackets < to [
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions
answered
Veteran Member

Simple, elegant and works like a charm!! :D

Many thanks, TammyK

p.s. a thought occurs... You've to go to this trouble to put code in an article, but anyone commenting on the article can use the "text as code" BB button as well as nearly 40 other buttons!
Edited by HobbyMan on 11-07-2008 16:10,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

K
K
/Kenneth
  • Junior Member, joined since
  • Contributed 23 posts on the community forums.
  • Started 1 thread in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet