当我尝试使用正则表达式进行过滤时,我一直得到空结果。我试图从包含表单输入参数的httprequest中过滤特殊字符,麻烦的是,它没有发布我能看到的任何内容,
我的代码看起来像这样
<?php
$string = 'POST /login.php HTTP/1.1
Host: www.copyscape.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://www.copyscape.com/login.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 74
Cookie: ck=BXLD2UDMUA88KWGC0GK8WCGOC; PHPSESSID=8cup5f02hbetnbfbbv9vug37q0
Connection: keep-alive
Upgrade-Insecure-Requests: 1
login_username=jeezman88%40vfxm.mail.com.com&login_password=(Passw0rd)&log_in=Log+inÿÿÿ7—R';
preg_match('/=\/&\$\%/',$string, $match);
echo $match[1];
?>
现在我似乎不明白为什么它不会从这里判断任何信息
修改:我想使用文本中的preg_match()
来过滤和回显此参数,我该怎么做?
login_username=jeezman88%40vfxm.mail.com.com&login_password=(Passw0rd)&log_in=Log+inÿÿÿ7—R