请检查我的代码,我得到以下输出:
in wood that 1
in wood that 2
in wood that 3
in wood that 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);
谢谢和亲切的问候,