Archives by date

You are browsing the site archives by date.

【PHP】サポートされているエンコーディング一覧を取得する。

前回の記事←に引き続き一覧取得系関数。

文字コード周りで嵌った時の手助けになりそう。

$list = mb_list_encodings();
var_dump($list);
↓
array(73) {
  [0]=>
  string(4) "pass"
  [1]=>
  string(4) "auto"
  [2]=>
  string(5) "wchar"
  [3]=>
  string(7) "byte2be"
  [4]=>
  string(7) "byte2le"
  [5]=>
  string(7) "byte4be"
  [6]=>
  string(7) "byte4le"
  [7]=>
  string(6) "BASE64"
  [8]=>
  string(8) "UUENCODE"
  [9]=>
  string(13) "HTML-ENTITIES"
  [10]=>
  string(16) "Quoted-Printable"
  [11]=>
  string(4) "7bit"
  [12]=>
  string(4) "8bit"
  [13]=>
  string(5) "UCS-4"
  [14]=>
  string(7) "UCS-4BE"
  [15]=>
  string(7) "UCS-4LE"
  [16]=>
  string(5) "UCS-2"
  [17]=>
  string(7) "UCS-2BE"
  [18]=>
  string(7) "UCS-2LE"
  [19]=>
  string(6) "UTF-32"
  [20]=>
  string(8) "UTF-32BE"
  [21]=>
  string(8) "UTF-32LE"
  [22]=>
  string(6) "UTF-16"
  [23]=>
  string(8) "UTF-16BE"
  [24]=>
  string(8) "UTF-16LE"
  [25]=>
  string(5) "UTF-8"
  [26]=>
  string(5) "UTF-7"
  [27]=>
  string(9) "UTF7-IMAP"
  [28]=>
  string(5) "ASCII"
  [29]=>
  string(6) "EUC-JP"
  [30]=>
  string(4) "SJIS"
  [31]=>
  string(9) "eucJP-win"
  [32]=>
  string(8) "SJIS-win"
  [33]=>
  string(5) "CP932"
  [34]=>
  string(7) "CP51932"
  [35]=>
  string(3) "JIS"
  [36]=>
  string(11) "ISO-2022-JP"
  [37]=>
  string(14) "ISO-2022-JP-MS"
  [38]=>
  string(12) "Windows-1252"
  [39]=>
  string(12) "Windows-1254"
  [40]=>
  string(10) "ISO-8859-1"
  [41]=>
  string(10) "ISO-8859-2"
  [42]=>
  string(10) "ISO-8859-3"
  [43]=>
  string(10) "ISO-8859-4"
  [44]=>
  string(10) "ISO-8859-5"
  [45]=>
  string(10) "ISO-8859-6"
  [46]=>
  string(10) "ISO-8859-7"
  [47]=>
  string(10) "ISO-8859-8"
  [48]=>
  string(10) "ISO-8859-9"
  [49]=>
  string(11) "ISO-8859-10"
  [50]=>
  string(11) "ISO-8859-13"
  [51]=>
  string(11) "ISO-8859-14"
  [52]=>
  string(11) "ISO-8859-15"
  [53]=>
  string(11) "ISO-8859-16"
  [54]=>
  string(6) "EUC-CN"
  [55]=>
  string(5) "CP936"
  [56]=>
  string(2) "HZ"
  [57]=>
  string(6) "EUC-TW"
  [58]=>
  string(5) "BIG-5"
  [59]=>
  string(6) "EUC-KR"
  [60]=>
  string(3) "UHC"
  [61]=>
  string(11) "ISO-2022-KR"
  [62]=>
  string(12) "Windows-1251"
  [63]=>
  string(5) "CP866"
  [64]=>
  string(6) "KOI8-R"
  [65]=>
  string(6) "KOI8-U"
  [66]=>
  string(9) "ArmSCII-8"
  [67]=>
  string(5) "CP850"
  [68]=>
  string(6) "JIS-ms"
  [69]=>
  string(7) "CP50220"
  [70]=>
  string(10) "CP50220raw"
  [71]=>
  string(7) "CP50221"
  [72]=>
  string(7) "CP50222"
}

【PHP】サポートされているハッシュアルゴリズム一覧を取得する。

ちょっと面白かったのでメモ。

普段md5かsha512くらいしか使わないけど、今後は積極的に色々とためしてみようかな。

$list = hash_algos();
var_dump($list);
↓
array(42) {
  [0]=>
  string(3) "md2"
  [1]=>
  string(3) "md4"
  [2]=>
  string(3) "md5"
  [3]=>
  string(4) "sha1"
  [4]=>
  string(6) "sha224"
  [5]=>
  string(6) "sha256"
  [6]=>
  string(6) "sha384"
  [7]=>
  string(6) "sha512"
  [8]=>
  string(9) "ripemd128"
  [9]=>
  string(9) "ripemd160"
  [10]=>
  string(9) "ripemd256"
  [11]=>
  string(9) "ripemd320"
  [12]=>
  string(9) "whirlpool"
  [13]=>
  string(10) "tiger128,3"
  [14]=>
  string(10) "tiger160,3"
  [15]=>
  string(10) "tiger192,3"
  [16]=>
  string(10) "tiger128,4"
  [17]=>
  string(10) "tiger160,4"
  [18]=>
  string(10) "tiger192,4"
  [19]=>
  string(6) "snefru"
  [20]=>
  string(9) "snefru256"
  [21]=>
  string(4) "gost"
  [22]=>
  string(7) "adler32"
  [23]=>
  string(5) "crc32"
  [24]=>
  string(6) "crc32b"
  [25]=>
  string(7) "salsa10"
  [26]=>
  string(7) "salsa20"
  [27]=>
  string(10) "haval128,3"
  [28]=>
  string(10) "haval160,3"
  [29]=>
  string(10) "haval192,3"
  [30]=>
  string(10) "haval224,3"
  [31]=>
  string(10) "haval256,3"
  [32]=>
  string(10) "haval128,4"
  [33]=>
  string(10) "haval160,4"
  [34]=>
  string(10) "haval192,4"
  [35]=>
  string(10) "haval224,4"
  [36]=>
  string(10) "haval256,4"
  [37]=>
  string(10) "haval128,5"
  [38]=>
  string(10) "haval160,5"
  [39]=>
  string(10) "haval192,5"
  [40]=>
  string(10) "haval224,5"
  [41]=>
  string(10) "haval256,5"
}