The PHP highlight_string() function outputs a string with the PHP syntax highlighted. The syntax is highlighted by using HTML tags.

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

Syntax

				
					highlight_string(string, return)
				
			

Parameters

ParameterDescription
stringSpecifies the string to be highlighted (required)
returnIf set to TRUE, this function will return the highlighted code as a string, instead of printing it out (default is FALSE)