开发者

PHP: HOw to store and retrieve the data entered by a user in a text field from a file?

开发者 https://www.devze.com 2022-12-29 03:42 出处:网络
HI all, I want to Store the data entered by user in a file. If a user enters his description in a text field, Then i Have to store the data in a file.

HI all,

I want to Store the data entered by user in a file.

If a user enters his description in a text field, Then i Have to store the data in a file. All the users data will go to the same file with their user name and description.

And I have to retrieve The Data from that file for a particular user.

For example if there are two u开发者_如何转开发sers with their descriptions in the file, Then I have to retrieve a particular users description and print it on the users page.

How can I store and retrieve The data from a file?


You have a wide choice of formats: php serialized (serialize), php source (var_export), json (json_encode), xml (SimpleXML) and so on. Note that all of those require the whole file to be loaded in memory, which might be not appropriate if you have, say, 100000 users. But in that case you're better off with a database anyways.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号