[ create a new paste ] login | about

Link: http://codepad.org/qnLGqP7N    [ raw code | output | fork ]

PHP, pasted on Jul 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

$markup = <<<MARKUP
<div class="test-code">    
   <pre>
       <code>
          <?php echo "hello world"; ?>
       </code>
    </pre>
</div>
MARKUP;

echo highlight_string($markup);


Output:
1
2
3
4
5
6
7
8
9
<code><span style="color: #000000">
&lt;div&nbsp;class="test-code"&gt;&nbsp;&nbsp;&nbsp;&nbsp;
<br />&nbsp;&nbsp;&nbsp;&lt;pre&gt;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;code&gt;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"hello&nbsp;world"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;
<br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/code&gt;
<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/pre&gt;
<br />&lt;/div&gt;</span>
</code>1


Create a new paste based on this one


Comments: