Skip to content

Instantly share code, notes, and snippets.

Rodrigo54 / php-html-css-js-minifier.php
Last active Nov 18, 2020 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
View php-html-css-js-minifier.php
* -----------------------------------------------------------------------------------------
* Based on ``
* -----------------------------------------------------------------------------------------
// HTML Minifier
function minify_html($input) {
nbouvrette / inputTypeNumberPolyfill.js
Last active Apr 18, 2019
Stand alone JavaScript polyfill allow only numbers on input of type number.
View inputTypeNumberPolyfill.js
* Stand alone polyfill allow only numbers on input of type number.
* While input filtering is already supported by default by some browsers, maximum length has not been implemented by
* any. This script will solve both issue and make sure that only digits can be entered in input elements of type
* number. If the optional attribute `max` is set, it will calculate it's length and mimic the `maxlength` behavior on
* input of type text.
* Supports:
vyspiansky / image-src-regexpr.php
Last active Aug 10, 2020
PHP: get image src attribute (regular expression)
View image-src-regexpr.php
// Source:
$html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />';
preg_match( '@src="([^"]+)"@' , $html, $match );
$src = array_pop($match);
// will return /images/image.jpg
You can’t perform that action at this time.