截取一个select语句并替换语句中的列名
$sql = 'select id,name,sex from user limit 10,100';
$dis = strripos($sql,'limit');
if($dis!==false)
{
$sql = substr($sql,0,$dis);
$str = substr($sql, stripos($sql,'select')+6,stripos($sql,'from')-6);
$sql = str_replace($str,' count(t.taskid) ',$sql);
$sql = substr($sql,0,strripos($sql,'order'));
}