文本文件反向读取 [英] Text file Reverse reading

查看:106
本文介绍了文本文件反向读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




嗯,我的名字是费萨尔,你可能会看到我的身份证。我在几个月前进入了php ...


我需要帮助..我正在尝试读取.txt格式的文件..

逐行,反向行动..


我的意思是从上一行到第一行..我真的不在乎......我可以把它写在我对PHP的记忆中..没有问题..


你能告诉我怎么做这项工作吗?


我的意思是如果我可以做一个阵列..所以你能指导我怎么样吗?我在数组方面不太好;)


请帮助...


等待回答!


FAISAL!

Hi,

Well, My name is Faisal, You might saw as my ID. I got into php before a few months...

I need help.. I am trying to read a file that is .txt format..
Line by Line, Reverse action..

I mean from Last to 1st line.. I really don''t care.. I can write them on my memory of php.. No matter..

Can you advice me how can I do this work?

I mean if i can do from an array.. So can you guide me how? I am not so good in arrays ;)

Help please...

Waiting for answer!

FAISAL!

推荐答案

Faisal,欢迎来到The Scripts。


一次性阅读整个文件一个数组(每个条目1行)可能是最容易做到这一点的。因此,您使用PHP file()命令。请参阅文档 file()命令


Ronald
Faisal, welcome to The Scripts.

Reading an entire file in one go into an array (1 line per entry) might be the easiest wsy of doing this. Therefore you use the PHP file() command. See documention file() command

Ronald



Faisal,欢迎来到The Scripts。


一次读取整个文件到一个数组(每个条目1行)可能是最简单的方法。因此,您使用PHP file()命令。请参阅文档 file()命令


Ronald
Faisal, welcome to The Scripts.

Reading an entire file in one go into an array (1 line per entry) might be the easiest wsy of doing this. Therefore you use the PHP file() command. See documention file() command

Ronald



感谢Ronald,

嗯,正如我已经说过我在循环中如此糟糕:(

你能写一个小代码,我可以在其中反复阅读shoutboxdb.txt文件的内容吗???


谢谢。 。


FAISAL!

Thanks Ronald,
Well, as i already said I am so bad in looping :(
Can you please write a small code in which i can read the content of "shoutboxdb.txt" file in reverse Action???

Thanks..

FAISAL!


你的意思是你想从右到左读取 ASCII 字符吗?喜欢当文本行从左到右时:
Do you mean that you want ASCII characters to be read from right to left? Like when the text line says left-to-right:
展开 | 选择 | Wrap | 行号


这篇关于文本文件反向读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆