- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
highlight_file() function in PHP
The highlight_file() function outputs a file with the PHP syntax highlighted.
Syntax
highlight_file(file, return)
Parameters
file − The file name to display.
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.
Return
The highlight_file() function returns the highlighted code as a string instead of printing it. Returns true on success, or false on failure, otherwise.
Example
The following is an example, wherein we are using a test file ("new.php") to output the file with the PHP syntax highlighted.
<html> <body> <?php highlight_file("new.php"); ?> </body> </html>
Output
The output of the browser.
<html> <body> <?php echo ("new.php"); ?> <body> <html>
Advertisements