How to highlight the source code in our php application?

Hi friends,

In our php application some times we want to highlight the source code to user friendly , so the following function helped you to highlight the source code.

if (!empty($_POST['text'])){
echo '<div style="border: solid 1px red; width:300px;height: 150px; padding: 20px; margin: 20px">';
echo '</div>';
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<textarea name="text" style="width: 300px; height: 150px;padding: 20px; margin: 20px"><?php echo stripslashes($_POST['text']);
<br />
<input type="submit" />

The output of this code will be –

Code highlight in php application

Code highlight in php application

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

1 Response

  1. Rakesh says:

    Hi Ani,

    Nice post..if you post in ror also then it is better to me.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.