note 71505 added to function.highlight-string
| From: | Idunno at osu1 dot php dot net | Date: | Sat, 02 Dec 2006 21:39:46 +0000 |
| Subject: | note 71505 added to function.highlight-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120239@lists.php.net to get a copy of this message | ||
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
----
Server IP: 64.71.164.2
Probable Submitter: 69.117.26.164
----
Manual Page -- http://www.php.net/manual/en/function.highlight-string.php
Edit -- https://master.php.net/note/edit/71505
Del: integrated -- https://master.php.net/note/delete/71505/integrated
Del: useless -- https://master.php.net/note/delete/71505/useless
Del: bad code -- https://master.php.net/note/delete/71505/bad+code
Del: spam -- https://master.php.net/note/delete/71505/spam
Del: non-english -- https://master.php.net/note/delete/71505/non-english
Del: in docs -- https://master.php.net/note/delete/71505/in+docs
Del: other reasons-- https://master.php.net/note/delete/71505
Reject -- https://master.php.net/note/reject/71505
Search -- https://master.php.net/manage/user-notes.php