splitを使用する。
$test = “abc”;
こんな文字列を格納した変数があるとして、
$test_2 = split(“b”,$test);
こうすると、$test_2は、配列となり、
$test_2[0]は、a
$test_2[1]は、c
となる。
split(“切る文字”,”切られる物”);こんな感じでしょう。
参照はこちら。このほかにも、色々切る方法は、ありそうだ。
http://jp.php.net/manual/ja/function.split.php
[...] 文字列を、指定した文字で切る [...]
Name (required)
Mail (will not be published) (required)
Website
Comments