Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3239670
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:59:50+00:00 2026-05-17T17:59:50+00:00

I have started making a syntax highlighter in php (only a quick one) and

  • 0

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/", "&nbsp&nbsp&nbsp&nbsp ", $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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:59:50+00:00Added an answer on May 17, 2026 at 5:59 pm

    Thanks for the semi-colon thing but I’v realised I’v been a complete moron, instead of setting the new value I just called preg_replace! Silly me! Thanks anyway, it still wouldn’t of worked without the semi colons. Thanks 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have checked out code from a svn repository and started making changes. But
I am current making some small JS game in Netbeans and I have started
I have gone though the JBehave official docs and have started making a sample
I have recently started making a C++ Wrapper of GTK+ (Nothing special, just wrapping
I have just started making a wp-site . I have a small problem with
I have an application developed on the iphone. I have recently started making it
I have started HTML. I am making tables in it. I just tried breaking
I have recently started making (and am still making) the transition from ActionScript 2
I have started making graphics for my Android app using Adobe Photoshop. But I
I have started learning titanium framework.I was making application into iphone.I have made application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.