我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在目录中搜索字符串

I've came up with a script to find a certain string in a directory, but when I do it, it only shows the first string and not the others... how would I go about it showing all of the other strings?

The code,

$result = exec("grep -r admin@admin.com /var/www/html/files/*");
echo $result;

Thank you!

Try exec("grep -r admin@admin.com /var/www/html/files/*", $result);. According to PHP manual exec return the last line from the result of the command

近期文章

  • 在Wordpress中包含jquery UI
  • 使用/?lang = de进行永久重定向301
  • Codeigniter:INSERT INTO验证
  • 一个数组字符串中的多个匹配
  • 多个复选框和PHP的问题
  • 在传单中获取缓冲区内的点
  • 为什么我在json中加倍我的显示
  • 如何在codeigniter中循环表视图
  • 使用c#将params设置为Web服务
  • 使用html2canvas将屏幕截图保存到web文件夹
  • 只有变量应该通过引用php传递
  • 如何使用Select2进行Ajax加载选择?
  • MYSQL PDO更新datetime什么都不做[重复]
  • 如何在字符串中创建循环
  • Api facebook v5一般统计
  • Codeigniter $ this-> cache-> memcached-> save('foo','bar',600)返回false
  • 随机图像的3x3表 - PHP
  • 在PHP中从pdf中提取文本并不适用于所有PDF文件
  • 将数据从HTML页面发送到PHP脚本并在PHP中选择数据
  • PHP,从表单获取值(包含来自数据库的数据,在循环中)

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华