Skip to content

Instantly share code, notes, and snippets.

@ve3
ve3 / strftime-to-intldateformatter-converter.php
Last active June 19, 2023 12:33
Convert strftime format to IntlDateFormatter pattern.
<?php
/**
* PHP `strftime()` format to `IntlDateFormatter()` pattern converter.
*
* PHP `strftime()` is deprecated since v 8.1. They recommended to use `IntlDateFormatter()` instead.
* However `IntlDateFormatter()` pattern does not fully supported all format that `strftime()` does.
*
* Run this file to get the result of most close pattern to `strftime()` based on Thai locale.
*
* @license MIT
@hazdik
hazdik / arrow-buttons-for-responsive-horizontal-scroll-menu.markdown
Created October 3, 2018 08:22
Arrow buttons for responsive horizontal scroll menu
@jasny
jasny / linkify.php
Last active October 21, 2023 16:28
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())