Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
似乎无法弄清楚这一点。只是尝试在链接 URL 中匹配特定变量名称:
<a href="http://something.com?variable=name">GenericLink</a>
如何从中获取变量=名称?
谢谢!
提取整个 url,然后使用 parse_url();
$str = '<a href="http://something.com?variable=name">GenericLink</a>'; preg_match('/href="([^"]*)/i',$str,$matches); var_dump(parse_url($matches[1]));