什么是更好的?外部页面或数据库 [英] What is better? an external page or a database
本文介绍了什么是更好的?外部页面或数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想存储(以后检索)数组。
最简单和最好的方法是什么?
解决方案
取决于你想要存储多长时间:在一段时间的会话期间?
在会话期间你可以将数组存储在
中
_SESSION数组。在会话中,您可以存储在数据库中。
最简单的方法是首先在数组上使用PHP serialize()函数,使其成为可以存储在任何地方的字符串。在字符串变量中再次检索iy后,您可以再次使用PHP unserialize()函数重新构建数组。
Ronald:很酷:
< BLOCKQUOTE>无。我不想要的只是那个会议。
我希望它能持续至少一周,而且我的服务器上,不是HIS系统
所以,我想我会使用序列化(),但是我应该如何存储呢?
(这是我原来的问题)
Thanx,
I want to store (and later retrieve) an array.
How is the simplest and best way to do so?
解决方案
Depends on how long you want to store it: for the duration of a session of over sessions?
For the duration of a session you can store the array in the
_SESSION array. Over sessions you can store in in the database.
It would be easiest to first use PHP serialize() function on the array to make it into a string that can be stored anywhere. After retrieving iy back again in a string variable, you can then use PHP unserialize() function to reconstruct the array again.
Ronald :cool:
No. I don''t want is only for that session.
I want it to last at least a week, and on MY server, not HIS system
So, I guess I''ll use the serialize(), but how should I store it?
(that was my original question)
Thanx,
这篇关于什么是更好的?外部页面或数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文