Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用preg_match将内容作为括号内的数组获取_Php_Regex_Preg Match - Fatal编程技术网

Php 如何使用preg_match将内容作为括号内的数组获取

Php 如何使用preg_match将内容作为括号内的数组获取,php,regex,preg-match,Php,Regex,Preg Match,输入: 输出: $mathes[1]=>主键相关选项 PRIMARY KEY (`attribute_id`,`user_id`,`history_id`), FULLTEXT KEY `value` (`value`) $mathes[1] = array(attribute_id,user_id,history_id) $mathes[2]=>全文键相关选项 PRIMARY KEY (`attribute_id`,`user_id`,`history_id`), FULLTEXT KEY

输入:

输出:

$mathes[1]=>主键相关选项

PRIMARY KEY (`attribute_id`,`user_id`,`history_id`), FULLTEXT KEY `value` (`value`)
$mathes[1] = array(attribute_id,user_id,history_id)
$mathes[2]=>全文键相关选项

PRIMARY KEY (`attribute_id`,`user_id`,`history_id`), FULLTEXT KEY `value` (`value`)
$mathes[1] = array(attribute_id,user_id,history_id)

我想使用preg_match获取主键和全文键,欢迎任何可能的建议。

到目前为止,您尝试了什么?发布您的代码,这样我们就可以帮助您不直接使用
show index from
查询数据库了吗?已从转储文件获取查询。