PHP code example of taufik-nurrohman / minify

1. Go to this page and download the library: Download taufik-nurrohman/minify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

taufik-nurrohman / minify example snippets



use function x\minify\c_s_s as minify_css;
use function x\minify\h_t_m_l as minify_html;
use function x\minify\j_s as minify_js;
use function x\minify\j_s_o_n as minify_json;
use function x\minify\p_h_p as minify_php;
use function x\minify\x_m_l as minify_xml;

l;
use function x\minify\j_s as minify_js;
use function x\minify\j_s_o_n as minify_json;
use function x\minify\p_h_p as minify_php;
use function x\minify\x_m_l as minify_xml;

ation. That way, you can use only the function aliases that you find more pleasant to type.

[article/strict-convert]: https://mecha-cms.com/article/strict-convert
[tweak/functions]: #globally-reusable-functions

This converter focuses only on white-space removal. Other optimizations are considered as a bonus. It can’t read your
code and only does generic tokenization, like grouping comments and strings into a single token. It won’t fix your code,
like adding an optional semi-colon at the end of a line because it was followed by a line-break, so the semi-colon was
optional in that situation. But then your JavaScript code will probably break after the minification, because the


c_s_s(?string $from): ?string;
~~~

### HTML

~~~ php


h_t_m_l(?string $from): ?string;
~~~

### JS

~~~ php
j_s(?string $from): ?string;
~~~

### JSON

~~~ php


j_s_o_n(?string $from): ?string;
~~~

### PHP

~~~ php


p_h_p(?string $from): ?string;
~~~

### XML

~~~ php


x_m_l(?string $from): ?string;
~~~

Tests
-----

Clone this repository into the root of your web server that supports PHP and then you can open the `test.php` file with
your browser to see the result and the performance of this converter in various cases.

Tweaks
------

### Globally Reusable Functions

You can use this method to shorten function names globally:

~~~ php