PHP Classes

How to Prettify PHP Code to Display it in a More Readable Way - PHP Prettify package blog

Recommend this page to a friend!
  All package blogs All package blogs   PHP Prettify PHP Prettify   Blog PHP Prettify package blog   RSS 1.0 feed RSS 2.0 feed   Blog How to Prettify PHP C...  
  Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)  

Author:

Package: PHP Prettify

PHP comes with built-in support to parse PHP code to generate HTML that can display the code in a highlighted format using color.

This package implements a better solution for displaying PHP code in Web pages.

It can highlight the code using colors, add line numbering, highlight specific lines or just part of the code of a script, and highlighting the code using themes configured using separate files in JSON format.




Loaded Article

About the PHP Prettify Package

The package PHP Prettify is one of the few PHP packages that was considered notable recently because it does something that is worth paying attention.

The basic purpose is: Output colored PHP code highlighted using themes

Here follows in more detail what it does:

This package can output colored PHP code highlighted using themes.

It can take the name a file of PHP script and parses it to extract its structure.

The class returns a HTML string with the original PHP code formatted to highlight different aspects of the PHP syntax. The resulting output can:

- Include line numbers on the side of the code
- Have a specific line being highlighted in a different way
- Return only a part of the original code being highlighted, like for instance only a class definition
- Use a separate configuration file in JSON format to define output presentation themes for different versions of PHP like PHP 5 and PHP 7

Conclusion

The PHP Prettify can be downloaded from download page or be installed using the PHP Composer tool following instructions in the Composer install instructions page.

This package was considered notable for implementing its benefits in a way that is worth noticing.

Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.

If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.

One nice prize that many PHP developers want and you may like is the PHP elePHPant mascot plush.




You need to be a registered user or login to post a comment

Login Immediately with your account on:



Comments:

1. error in README.MD - David Sotomonte (2020-09-19 10:36)
function theme is not ok... - 0 replies
Read the whole comment and replies



  Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)  
  All package blogs All package blogs   PHP Prettify PHP Prettify   Blog PHP Prettify package blog   RSS 1.0 feed RSS 2.0 feed   Blog How to Prettify PHP C...