コードを確認してください。次の出力が表示されます。
in wood that 1
in wood that 2
in wood that 3
in wood that 4
以下に示すコードから、これらの4行をMySQLデータベースに保存したいと思います。
$string = "imperfection in wood that 1 can appear during the wood drying process.imperfection in wood that 2 can appear during the wood drying process.imperfection in wood that 3 can appear during the wood drying process.imperfection in wood that 4 can appear during the wood drying process";
preg_match_all('/(imperfection)(.*?)(can)/', $string, $matches);
foreach($matches[2] as $value)
echo $value.'<br />';
$sql="INSERT INTO string_check(st_name)VALUES($value)";
$result=mysql_query($sql);
よろしくお願いいたします。