您好,欢迎访问一九零五行业门户网

在PHP中,highlight_string()函数的作用是将给定的字符串以HTML格式进行高亮显示

highlight_string()函数输出带有php语法高亮的字符串。
syntaxhighlight_string(string, return)
parametersstring − the string to highlight.
return −if this parameter is set to true, this function will return the highlighted code as a string, instead of printing it out. default is false.
returnthe highlight_string() function returns true on success, or false on failure.
examplethe following is an example that output a string with the php syntax highlighted.
<!doctype html><html> <body> <?php highlight_string("demo text! <?php phpinfo(); ?>"); ?> </body></html>
outputthe following is the output.
hello world! <?php phpinfo(); ?>
以上就是在php中,highlight_string()函数的作用是将给定的字符串以html格式进行高亮显示的详细内容。
其它类似信息

推荐信息