Current location: Hot Scripts Forums » Programming Languages » PHP » highlight_string()


highlight_string()

Reply
  #1 (permalink)  
Old 08-04-04, 04:17 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
highlight_string()

Hey,
I was wondering... you know how if i post a php code here using the php bbcod , it doesn't need to have <?php (or <?) or ?> to be displayed...
PHP Code:

highlight_string(); 

Well how can I do that (i already know hwo to do it but it needs to have <?php (<?) or ?> to work) so that it doesn't really need to have the starting php tags to display the code in php color?

Thank you, hope you know what i mean :S
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #2 (permalink)  
Old 08-04-04, 08:37 PM
jasong jasong is offline
Wannabe Coder
 
Join Date: Feb 2004
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
what i said didnt make any sense

Last edited by jasong; 08-04-04 at 08:41 PM.
Reply With Quote
  #3 (permalink)  
Old 08-05-04, 01:40 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jasong
what i said didnt make any sense
o? didn't see it ... but i hope you know what i mean.
I just want to know how I can highlight a php code that doesn't have <?php at the beginning and ?> at the end... basically like the example shown in my first post
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #4 (permalink)  
Old 08-05-04, 09:26 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Anyone know how?
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #5 (permalink)  
Old 08-06-04, 01:45 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Nvm, i figured it out but im not 100% if this is bug free
PHP Code:

if($added == TRUE) {


            $after_replace = str_replace('<?php<br /> ', '', $after_replace);

            $after_replace = str_replace('
<span style="color: #0000BB">?></span>', '', $after_replace);

        }
But it seems to work now
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 04:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.