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

				
					<?php
highlight_file('test.php');
?>
				
			

Syntax

				
					highlight_file(filename, return)
				
			

Parameters

ParameterDescription
filenameSpecifies the file 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)