我有一个HTML表单字段$_POST["url"],其中包含一些URL字符串作为值。示例值包括:
https://example.com/test/1234?email=xyz@test.com https://example.com/test/1234?basic=2&email=xyz2@test.com https://example.com/test/1234?email=xyz3@test.com https://example.com/test/1234?email=xyz4@test.com&testin=123 https://example.com/test/the-page-here/1234?someurl=key&email=xyz5@test.com
等等
如何email仅从这些URL /值中获取参数?
请注意,我没有从浏览器地址栏中获取这些字符串。
/(email=\w\@\w\.\w)/和更高级的匹配技术一样简单。只是给你的想法。参见preg_match函数:php.net/manual/en/function.preg-match.php