这样的递归怎么做?!
<br />select a,<br />(select b from c where ...) as d,<br />e<br />from f,(select j from h where ...) as i<br />where ....<br />
<br />select count(*)<br />from f,(select j from h where ...) as i<br />where ....<br />
$s = <<< TXT<br />select a,<br />(select b from c where ...) as d,<br />e<br />from f,(select j from h where ...) as i<br />where ....<br />TXT;
$ar = preg_split('/(\(?\bselect\b
------解决方案--------------------
\bfrom\b)/i', $s, -1, PREG_SPLIT_NO_EMPTY
------解决方案--------------------
PREG_SPLIT_DELIM_CAPTURE);
$n = 0;
$st = array();
for($i=0; $i$t = strtolower($ar[$i]);
if($t == 'select'
------解决方案--------------------
$t == '(select') {
$st[] = $i;
}
if($t == 'from') {
if(count($st) == 1) break;
array_pop($st);
}
}
for($i--; $i>$st[0]+1; $i--) unset($ar[$i]);
$ar[$st[0]+1] = " count(*)\n";
echo join('', $ar);
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号