首页 新闻 会员 周边

php中如何通过关键字查找文件中包含该关键字的所有行内容呢

0
悬赏园豆:5 [已解决问题] 解决于 2011-10-13 17:41

例如

Oct 23 06:41:49 localhost init: Starting pid 2452, console /dev/tty1: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2451, console /dev/ttyS0: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2454, console /dev/tty3: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2453, console /dev/tty2: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2455, console /dev/tty4: '/sbin/getty'

这样一个文件,输入Starting pid 2455可以查找出最后一行。我想应该是一个有关字符串的函数把,但是不知道用哪个?求教了!谢谢额!

笨笨的菜鸟的主页 笨笨的菜鸟 | 初学一级 | 园豆:40
提问于:2011-10-13 09:27
< >
分享
最佳答案
0
收获园豆:5
artwl | 专家六级 |园豆:16736 | 2011-10-13 09:37
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册