可以使用preg_match函数来取出url中的weixin地址,正则表达式如下:

$pattern = "/weixin://(.*)/";

其中,weixin://表示要匹配的字符串为weixin://,后面的(.*)表示匹配任意字符,直到字符串结尾。

代码示例:

$url = "weixin://asdfadfadfad"; $pattern = "/weixin://(.*)/"; preg_match($pattern, $url, $matches); $weixin_url = $matches[1];

最终得到的$weixin_url即为weixin的地址。

var url=weixinasdfadfadfad;使用PHP正则取出上述代码中weixin的地址

原文地址: https://www.cveoy.top/t/topic/hte6 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录