I have started making a syntax highlighter in php (only a quick one) and so far I have got a code box generator (aka it creates a table with styles that looks good and can display source code and html code). At the moment when writing code with it I do this:
$code = "def example_ruby_code(does_it_work)
" . "(insert tab here) @does_it_work = false
" . "end"
codebox($code, "title_here.rb")
My trouble is that I know that I can't have tabs in html so I used the following:
preg_replace("/\t/", "     ", $code)
(this went in the codebox function) But it doesn't seem to work, the output just shows no indentation whatsoever. Any ideas? Thanks in advance, ell.