[!--quoteo(post=354966:date=Mar 14 2006, 05:52 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Mar 14 2006, 05:52 PM) [snapback]354966[/snapback][/div][div class=\'quotemain\'][!--quotec--] the issue is that you must TELL highlight_string() to return the value. by default, it only returns a TRUE or FALSE, so to run echo on it, you need to specify it to return the new string: [code] echo highlight_string(convert_bbcodes( $content ), true); [/code] hope this helps [/quote] no, because that will highlight all of the tutorial. the tutorials contain html aswell, and this causes html to show, not formatted. i need it to select only the php parts, and highlight that bit. i'm using bbcode [php [/code] tags for php code. i've done these files anyway. example: [a href=\"http://www.mfwp.net/test/test.php\" target=\"_blank\"]here[/a] test.php [code]<?php $dbhost = "localhost"; $dbuser = "*****"; $dbpass = "*****"; $dbname = "*****"; $connection = mysql_connect($dbhost, $dbuser, $dbpass) or die (mysql_error()); mysql_select_db($dbname, $connection) or die (mysql_error()); $query = "SELECT * FROM tutorials WHERE category = 'test'"; $result = mysql_query($query, $connection) or die (mysql_error()); $data = mysql_fetch_array($result); $content = nl2br($data['content']); $title = $data['title']; include("bbcode.php"); echo "$title<br><br>"; echo convert_bbcodes( $content ); ?>[/code] bbcode.php [code]<?php $bb_codes = array( '[code]' => '<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse" /> <tr> <td bgcolor="#DFDFFF" /><strong>CODE</strong></td> </tr> <tr> <td>', '[/code]' => '</td></tr></table>' ); function convert_bbcodes( $t ) { $search = array_keys( $GLOBALS['bb_codes'] ); $t = str_replace( $search, $GLOBALS['bb_codes'], $t ); $t = eregi_replace("\\[php\\]([^\\[]*)\\[/php\\]", "<?php<br>".highlight_string('\\1', true)."<br>?>",$t); return $t; } ?>[/code] database tutorial: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]hey this is the output i get from the highlight_string function. all tutorials are placed into a database like this. also bbcode tags are used, which might be the problem, it's echo'ing the highlight_string, which i don't think likes being echo'ed. anyway, examples. you'll see how this is done in the code. [codetag] [code=php:0]echo "my text or tutorial here, in this format.";[/code] [/codetag][/quote] hopefully, you'll understand the problem i have, and come up with a soloution. thanks.