i want to style highlight_string() how can i style it?

Recommended Answers

All 3 Replies

i want to style highlight_string() how can i style it?

yes, you can simply put the code you want to highlight (including the php opening tag) as a first parameter and the second parameter as to true if expect the return from this function the highlighted code or if set as false, the code will be printed directly.
more information here

yes, you can simply put the code you want to highlight (including the php opening tag) as a first parameter and the second parameter as to true if expect the return from this function the highlighted code or if set as false, the code will be printed directly.
more information here

no i want to style it. the output is sometimes a green color i dont like green. it wont let me change the color with span tags either.

no i want to style it. the output is sometimes a green color i dont like green. it wont let me change the color with span tags either.

ok, got it, that is done as par the colors defined in the built-in syntax highlighter for PHP.
Change "Syntax Highlighting mode" settings/colors directly inside the php.ini

Edit: It looks like -

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <span style="color: ???????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.