Join查询中表名替换:

$str = 'left join aaaaa on a.id=b.id left join bbbb as b a.id=b.id';
$tablePre = 'tutiantian_';
echo preg_replace('/(left join|right join|inner join)\s+(\w+)\s+/i'," $1 {$tablePre}$2 ",$str);

YPHP
967 声望77 粉丝

免费好用的素材站:[链接]