连载VS爆 [英] Serialize vs Implode

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

问题描述

你认为什么是更好的方式去在MySQL数据库中存储的记录里面的几个图片ID的?它只是在图像的ID,这将被用于从一个不同的库获取的图像。

What do you think is the better way to go about storing a few image id's inside a record in a MySQL database? It's just the image id's which will be used to fetch the images from a different library.

我破灭的ID在像1#4#7#9#10#12的纪录还是我只是序列化阵列和存储?在那里,通过使用所述一个,而不是其它任何性能好处?稳定性preferences?

Do i implode the id's in the record like 1#4#7#9#10#12 or do I just serialize the array and store that? Are there any performance benefits by using the one instead of the other? Stability preferences?

我刚才一直用破灭和爆炸,从来没有真正赋予它过多考虑。
谢谢你。

I have just always used implode and explode, never really gave it much thought. Thanks.

推荐答案

我pefer 连载或JSON-EN code。结果
它的灵活并例如将允许您添加在将来的图片标题和其他细节还有...

I would pefer serialize or JSON-encode.
It is more flexible and for example will allow you to add image title and other details there in future...

这篇关于连载VS爆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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