views:

71

answers:

3

I have written a small PHP framework and I want to make a website where I explain some basic features.

I want to display blocks of php code. Is there an easy to do this, preferably without JavaScript.

I want to have section kind of like displayed below:

// This function takes in a value and return it
public function getname($name){
  return $name;
}
A: 

You can take a look at http://alexgorbatchev.com/wiki/SyntaxHighlighter

Sean Kinsey
+1  A: 

For the server-side there are a few options already out there:

There are others, but just letting you know there are libraries available.

Nick Craver
Serverside does look interesting. I use a templating engine and I have to see I can make it work together. It will also remove the necessity of Javascript. Thank you for the insight.
Saif Bechan
Wow highlight_file works amazing for me. It is just what I wanted. Looks lightweight and easy to maintain.
Saif Bechan
A: 

On my Tumblr blog I use Prettify for syntax highlighting. You can have a look here.

I'm really pleased with its simplicity and it support a lot of languages out of the box.

Techpriester
Thank you for your answer. I do not know who downvoted you without leaving a comment, it was not me.
Saif Bechan