标签: php shell unix grep
我正在尝试使用
shell_exec("grep -rl '=".$_GET['s']."$'");
这什么都不返回,但是如果我删除$,它将返回所有匹配项(即使不是在行尾)。
请让我知道我在做错什么。
答案 0 :(得分:0)
您可以尝试:preg_match()
用于在行中搜索字符串,字符和文件扩展名
http://php.net/manual/en/function.preg-match.php