IT Community - Software Programming, Web Development and Technical Support

How do you colour code the source in the answers on alt-php-faq.org?

This is a discussion on How do you colour code the source in the answers on alt-php-faq.org? within the PHP Programming forums, part of the Web Development category; Hi all........ How do you colour code the source in the answers on alt-php-faq.org? Thanks & Regards, ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 09-12-2007, 12:44 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default How do you colour code the source in the answers on alt-php-faq.org?

Hi all........

How do you colour code the source in the answers on alt-php-faq.org?

Thanks & Regards,
Itbarota.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-12-2007, 12:56 AM
sans sans is offline
D-Web Programmer
 
Join Date: Apr 2007
Posts: 63
sans is on a distinguished road
Default Re: How do you colour code the source in the answers on alt-php-faq.org?

Hi itbarota...

<?
//$source contains the answer.
$nocode=0;
if(stristr($source,"<code>"))
{
$code=1;
do
{
list ($beginingtext,$code) = split ("<code>", $source,2);
list ($source,$endtext) = split ("<\/code>", $code,2);
echo nl2br($beginingtext);
highlight_string($source);
if(stristr($endtext,"<code>"))
{
$code=1;
$source=$endtext;
}else
{
$code=0;
}
}while($code==1);
echo nl2br($endtext);
echo "<P>";
}else
{
echo nl2br($source);
}
?>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/php-programming/3752-how-do-you-colour-code-source-answers-alt-php-faq-org.html
Posted By For Type Date
How do you colour code the source in the answers on alt-php-faq.org? by nookli This thread Pingback 11-10-2007 11:25 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep people from stealing my source code and/or images? oxygen HTML, CSS and Javascript Coding Techniques 3 10-18-2008 02:19 AM
How can I hide the JavaScript source code from "view source" function of the browser? KiruthikaSambandam HTML, CSS and Javascript Coding Techniques 1 11-13-2007 09:17 PM
Can we generate a C++ source code from the binary file? Sabari C and C++ Programming 1 07-30-2007 11:47 PM
block the source code Alan HTML, CSS and Javascript Coding Techniques 5 04-23-2007 02:21 AM
Need help on not letting visitors view my source code oyu2o Web Design Help 2 03-15-2007 03:43 PM


All times are GMT -7. The time now is 05:06 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0