memo

memo dayo.

指定文字列に挟まれた文字列をすべて配列として取得する


function ary_extraction ($str_old, $str_from, $str_to){
$ary_return = array();

while (True) {
$str_tmp = str_extraction($str_old, $str_from, $str_to, True);
if ($str_tmp === False) {
break;
}

$str_old = str_replace($str_tmp, '', $str_old);

$str_tmp = str_replace($str_from, '', $str_tmp);
$str_tmp = str_replace($str_to , '', $str_tmp);

if (strlen($str_tmp) > 0) {
$ary_return[] = $str_tmp;
}
}

return $ary_return;
}