943,675 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 473
  • PHP RSS
Apr 29th, 2009
-1

Code For Code tags..

Expand Post »
Good Morning All..

How to do coding for code tags , when we post a thread..And the display the content between the code tags with different color using PHP..

Thanks in Advance.

Shanti.
Reputation Points: 137
Solved Threads: 162
Posting Virtuoso
Shanti C is offline Offline
1,641 posts
since Jul 2008
Apr 29th, 2009
0

Re: Code For Code tags..

I dont know the actual method but I think following may work.
PHP Syntax (Toggle Plain Text)
  1. str_replace("code","<span style='your style'>",$yourtext);
  2. str_replace("/code","</span>",$yourtext);
You mus use full tag in your code i.e. \[code\]
Last edited by urtrivedi; Apr 29th, 2009 at 8:02 am.
Reputation Points: 245
Solved Threads: 259
Nearly a Posting Virtuoso
urtrivedi is offline Offline
1,249 posts
since Dec 2008
Apr 29th, 2009
-1

Re: Code For Code tags..

Have look at this article of what you can do with out any additional tools/libraries/plugins. However if you after tool you may consider GeSHi (I think dani use it here or she use it in past) or check result of this search and perhaps you find something for your self
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,654 posts
since Dec 2004
Apr 29th, 2009
0

Re: Code For Code tags..

thanks for you both..
i will work on this and let you know...
Reputation Points: 137
Solved Threads: 162
Posting Virtuoso
Shanti C is offline Offline
1,641 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: php header with mysql
Next Thread in PHP Forum Timeline: preg_replace $ entity





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC