Navigation

Search

highlight_php_code

Description

Uses PHP's highlight_code() to highlight PHP syntax.

Syntax

string highlight_php_code (string $code)



Parameter $code

Expected type: String
Description: The PHP code to highlight



Return value

Expected type: String
Description: The syntax-highlighted version of $code


Notes

  • Uses special handling to keep the tabs in the code available.
  • Used to parse PHP code from inside [code] and [php] tags.
  • Uses PHP's highlight_string() function to do the actual highlighting
  • Returns the code with highlighted HTML.
View all versions of this function