Jump to content

highlight_syntax() displays 1 after the function


MasterACE14

Recommended Posts

Evening Everyone,

 

I am using the highlight_syntax() function for some code, and it works fine, I echo it, and it shows the code highlighted, but it also echo's a 1 after all the code. Why is that?

 

I've tried substr() to remove it with no success.

 

Regards ACE

Remove the echo; the function will output itself if TRUE is not specified.

<?php
highlight_string("<?php echo \"Persons Name Subject\"; ?> ");
?>

 

EDIT: But if you wanna save the string in a variable, and then echo it out, this works fine for me (TRUE makes the function return the highlighted string instead of outputting it):

 

<?php
$str = highlight_string("<?php echo \"Persons Name Subject\"; ?>", TRUE);
echo $str;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.