Skip to content

Instantly share code, notes, and snippets.

@GreenFootballs
GreenFootballs / amazon_regex.md
Last active August 31, 2022 11:12
A PHP regular expression to match Amazon links and extract the ASIN identifier
~
    (?:(smile\.|www\.))?    # optionally starts with smile. or www.
    ama?zo?n\.              # also allow shortened amzn.com URLs
    (?:
        com                 # match all Amazon domains
        |
        ca
        |
        co\.uk
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active April 23, 2024 23:58 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {