special-characters - 使用 Preg_Match 提取特殊字符之间的两个值
问题描述
您好,我想用一个 preg_match_all 提取用户名和密码值
$url='http://xxxxxxxx.com:80/get.php?username=xxxxxx&password=xxxxxx&type=m3u_plus';
我得到了我想要的爆炸,但我知道 preg_match_all 效果更好,你能告诉我怎么做吗?
$url_ext = parse_url($url);
$username=explode ("&",explode("=",$url_ext['query'])[1]);
$password=explode ("&",explode("=",$url_ext['query'])[2]);
我尝试使用此代码但无法正常工作
$lotes_fil='~https?://.\=(.+?)&~';
preg_match_all($lotes_fil,$url,$link_pre);
解决方案
推荐阅读
- python - Resolve TypeError "can only concatenate tuple (not 'int') to tuple" with function designed to return all summation compositions
- sql - 查询以获取最大月数的值的总和
- javascript - 我如何独立使用 Babel 将 html 导入转换为变量?
- php - Foreach 无法正常工作 php in_array
- python - 在熊猫数据框中抖动几乎重复的行
- javascript - 创建一个按钮来隐藏/显示 d3.js 中的矩形和文本
- amazon-web-services - Amazon Managed Blockchain 的性能指标
- mysql - #1054 - 从 Mysql 导出到 MariaDB 后 order 子句中的未知列
- java - 在 IBM Domino 中创建重定向的 HTTP 请求的方式
- ruby-on-rails - 有人可以解释这种查找方法的行为吗?