This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: | |
| * if the separator is a slash (/), then the American m/d/y is assumed; | |
| * whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. | |
| */ | |
| strtotime('12/25/2014'); | |
| strtotime('25-12-2014'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function my_array_diff($a, $b) | |
| { | |
| $map = $out = array(); | |
| foreach ($a as $val) | |
| $map[$val] = 1; | |
| foreach ($b as $val) | |
| if (isset($map[$val])) | |
| $map[$val] = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana (*) | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
NewerOlder