我要取出表名。
------解决思路----------------------
<?php
$array = array("CREATE TABLE `order_log_1` (`_id` int(11) NOT NULL AUTO_INCREMENT,,`order_info` text,`insert_time` int(11) DEFAULT NULL,PRIMARY KEY (`_id`))",
"CREATE TABLE `order_log_2` (`_id` int(11) NOT NULL AUTO_INCREMENT,,`order_info` text,`insert_time` int(11) DEFAULT NULL,PRIMARY KEY (`_id`))",
"CREATE TABLE `order_log_3` (`_id` int(11) NOT NULL AUTO_INCREMENT,,`order_info` text,`insert_time` int(11) DEFAULT NULL,PRIMARY KEY (`_id`))",
);
$pattern = '/CREATE TABLE `(w+)`/i';
foreach ($array as $item) {
if (preg_match($pattern, $item, $match)) {
var_dump($match[1]);
}
}
?>
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群