note 71505 deleted from function.highlight-string by nlopess

From: Date: Fri, 29 Dec 2006 14:51:35 +0000
Subject: note 71505 deleted from function.highlight-string by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121010@lists.php.net to get a copy of this message
Note Submitter: I dunno ---- I can't get this to work. Trying to make a tutorial site, wanting to show off how you can combined switches and highlight_file() to show source code. But when I use highlight_string() to show the PHP code used I get an error message. This is the code on the page: <?php highlight_string("<?php switch ($_GET['showcode']): case 'signature': highlight_file('signature.php'); break; case 'poll': highlight_file('poll.php'); break; case 'form': highlight_file('form.php'); break; default: echo 'No code found, please go back and try again'; endswitch; ?>"); ?> This is the error message: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in W:\www\tutorials\show-code.php on line 2

« previous php.notes (#121010) next »