PHP从行号中获取字符串

时间:2015-08-11 20:35:36

标签: php

我使用php来获取网页的内容:

$fileContent = file_get_contents('http://insertwebsitenamehere.com');

有没有办法寻找一个行号并在该位置找回该行?

我知道如果fileContent是文件,您可以使用SplFileObject::Seek。我可以执行类似的操作而无需将其转换为文件吗?

1 个答案:

答案 0 :(得分:1)

您希望file()代替

$fileContent = file('http://insertwebsitenamehere.com');
echo $fileContent[39]; //line 40
相关问题