【发布时间】:2017-07-09 18:34:52
【问题描述】:
我为标题道歉,我不知道如何正确表达它
但问题来了:
preg_match_all("/ (<input[^>]+>) | <select[^>]+>(.+?)<\/select | <textarea[^>]+>([^<]+) /xims", $form, $matches);
在我正在查看的表单中,有一个文件上传输入
<input type="file" name="upload">
但是当我这样做时
print_r($matches);
我得到“文本”字段,但没有提取“文件”字段..
我也想在 $matches[] 中包含“文件”输入类型。
我的正则表达式很弱,我用谷歌搜索了很多,但没有找到准确的..
我会很感激你的回答,谢谢。
【问题讨论】:
-
检查并更正您的语法
int preg_match_all ( string $pattern , string $subject [, array &$matches [, int $flags = PREG_PATTERN_ORDER [, int $offset = 0 ]]] )(php.net/manual/en/function.preg-match-all.php)