0
0

More than 3 years have passed since last update.

PHP 検索・置換系の引数の順番まとめ

Posted at

\$needleと\$haystackどっちが先だったっけ?
といつも記憶喪失悩まされるのでメモ

関数 第1引数 第2引数 第3引数 第4引数 第5引数
strpos $haystack $needle $offset
substr_count $haystack $needle $offset $length
str_replace $search $replace $subject $count
preg_match $pattern $subject $matches $flags $offset
preg_replace $pattern $replace $subject $limit $count
preg_replace_callback $pattern $callback $subject $limit $count
array_search $needle $haystack $strict
array_filter $array $callback $flag
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0