foreach ($_POST as $key => $value)
この title_1、title_2、title_3 のような変数を作成した後。$title を $title_ + $id と等しくする必要があります
私が試したこと
$link = ${$title_ . $id};
$title= $title_[$id];
$title= $title_[$id];
コード
foreach ($_POST as $key => $value)
{
if (preg_match('/^id_(\d*)$/', $value, $matches))
{
$id = $matches[1];
if (isset($_POST['title_' . $id]))
{
//$link = ${$title_ . $id};
$title= $title_[$id];
//mysql_query("UPDATE table SET title='" . $title . "' where id='$id'");
}
}
}
}