自分用メモ。
引数の順番とか中身を忘れがちな関数。
mb_convert_encoding()× mb_convert_enco
rding
← rは不要!!
string mb_convert_encoding ( string $str , string $to_encoding [, mixed $from_encoding ] )
文字列 strの文字エンコーディングを、 オプションで指定した from_encoding から to_encoding に変換します。
※エンコーディング指定子
"auto" // "auto" は、"ASCII,JIS,UTF-8,EUC-JP,SJIS" に展開される
"UTF-8"
"EUC-JP"
"SJIS"
"JIS"
"eucjp-win"
"sjis-win"
str_replace()mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
この関数は、subject の中の search を全て replace に置換します。
(正規表現のような) 技巧的な置換ルールを必要としない場合、 preg_replace() の代わりにこの関数を常用するべきです。
explode()array explode ( string $delimiter , string $string [, int $limit ] )
文字列の配列を返します。この配列の各要素は、 string を文字列 delimiter で区切った部分文字列となります。
strpos()int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )
文字列 haystack の中で、 needle が最初に現れた位置を数字で返します。 PHP 5 以前の strrpos() とは異なり、この関数は needle パラメータとして文字列全体をとり、 その文字列全体が検索対象となります。
strstr()string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] )
haystack の中で needle が最初に現れる場所から文字列の終わりまでを返します。
date()string date ( string $format [, int $timestamp ] )
指定された引数 timestamp を、与えられた フォーマット文字列によりフォーマットし、日付文字列を返します。 タイムスタンプが与えられない場合は、現在の時刻が使われます。 つまり timestamp はオプションであり そのデフォルト値は time() の値です。
posted by taichistereo at 20:34
|
Comment(0)
|
PHP