LoginSignup
1
0

More than 3 years have passed since last update.

PHP 文字列

Last updated at Posted at 2019-09-10

指定した文字で分割

explode(分割文字,文字列);

一文字ずつ分割

str_split ( 分割対象文字列) ;

文字の切り取り

substr(文字列, 開始位置, 切り取る長さ);

置き換え

str_replace(置き換え前文字,置き換え後,文字列);

文字検索

strpos(文字列,検索文字);
//見つからない場合はfalse
//検索だけならif( strpos() !==false)を使用
//見つかった場合は対象位置を数字で返す
1
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
1
0