Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2012
    Location
    USA
    Posts
    82
    Thanks
    3
    Thanked 17 Times in 17 Posts

    highlight_string only using #000000 - INI File shows otherwise

    The line of code in question is:

    PHP Code:
    $content[$i] = highlight_string($content[$i], true); 
    However every single color hex is #000000 as seen here http://tristification.com/chit-chat/2/3

    I have checked the INI file and the default values are the normal colors, and php_info reveals that to be true aswell. I have also set them at the start of the page using ini_set() however every single color is #000000.

    Any thoughts? This is truly puzzling.

  • #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    whats the code for setting them and also whats the code for displaying this?
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Looks fine to me. I see the red, green, blue and orange as I would expect for that.
    The only thing I can suggest is perhaps your original didn't have the opening <?php in it. That is required for highlight string to work.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • Users who have thanked Fou-Lu for this post:

    TFlan (02-23-2013)

  • #4
    New Coder
    Join Date
    Dec 2012
    Location
    USA
    Posts
    82
    Thanks
    3
    Thanked 17 Times in 17 Posts
    Yea there were two problems that I found.

    For my code lines, I have to have <code>...</code> around each individual line. It uses CSS. Which I then applied highlight_string() to each individual line, so it thought it was all HTML and thus #000000 was applied.

    Also, I forgot the <?php ?>.

    Thanks for the responses, I didn't think I would've been able to figure it out, leading me to post it here. But I got it


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •