Jump to content

highlight_string


arunpatal

Recommended Posts

Hi,

If i have some code to display then i will do like this.

<?php highlight_string('<?php echo"Hello World"; ?>') ?>

But what if the code is big and content many '

For example

<?php highlight_string('<?php echo'Hello World' "Hello World" 'Hello World' "Hello World"; ?>') ?>

Is there a function which can auto add \ front of ' which is in highlight_string???

Link to comment
https://forums.phpfreaks.com/topic/284351-highlight_string/
Share on other sites

nope. source code needs to have proper syntax, otherwise it can not be understood by the system and will generate an error.

while you're writing your code you be making sure you escape the necessary characters to maintain valid syntax.

 

you can also do a precision find/replace to help with existing source code. find/replace can end up backfiring on you if you're unfamiliar, so be careful not to mess everything up. 

Link to comment
https://forums.phpfreaks.com/topic/284351-highlight_string/#findComment-1460486
Share on other sites

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.