Home Backend Development PHP Tutorial 这行代码高深莫测,哪位高手能看懂

这行代码高深莫测,哪位高手能看懂

Jun 13, 2016 pm 01:40 PM
quot serialize unserialize

这行代码高深莫测,谁能看懂?
phpwind数据库的job表中,有个reward字段,保存的字符串似乎是一种json格式,但我没见过这种格式,请问怎么用,有何优点?
似乎是任务执行后的规则配置,代码如下:

a:4:{s:4:"type";s:5:"money";s:3:"num";s:2:"10";s:8:"category";s:6:"credit";s:11:"information";s:17:"可获得 铜币 ";}

------解决方案--------------------
序列化后的。存储方便。
------解决方案--------------------
这是 php 序列化后的串,用 serialize 函数生成的
可用 unserialize 函数还原

示例的数据是一个用4个元素的关联数组,肯定是不能直接放在数据库中的
序列化的作用就是将复杂的数据结构转换成简单的字符串,这样就便于保存了
------解决方案--------------------

正解,用unserialize可以还原

探讨

序列化后的。存储方便。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Use PHP unserialize() function to implement deserialization Use PHP unserialize() function to implement deserialization Jun 27, 2023 am 08:01 AM

Serialization is the process of converting a data structure or object into a string for storage, transmission, or representation, and conversely, parsing a string into the original data structure or object. In PHP, we can use the serialize() function to serialize a variable into a string, and use the unserialize() function to deserialize a string into a primitive data structure or object. This article will focus on the use and precautions of the PHPunserialize() function. 1. unserialize

A brief analysis of the usage of serialize and unserialize in php A brief analysis of the usage of serialize and unserialize in php Mar 24, 2023 pm 02:57 PM

PHP is a popular programming language commonly used for web development. Among them, serialize and unserialize are two very useful functions that can convert PHP objects into strings and deserialize them.

Use the PHP serialize() function to implement serialization of objects and arrays Use the PHP serialize() function to implement serialization of objects and arrays Jun 27, 2023 am 11:05 AM

In PHP, sometimes you need to convert objects or arrays into strings for storage or transmission. This process is called serialization, which converts the data structure into a sequence of strings so that the data can be transmitted and stored in different environments. PHP provides a built-in function serialize() that can implement serialization quickly and conveniently. 1. Serialization of arrays For an array, you can use serialize() to serialize it into a string. Here's an example. $arr=['apple

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题 不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题 Jun 13, 2016 am 10:15 AM

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。

图片消失怎么解决 图片消失怎么解决 Apr 07, 2024 pm 03:02 PM

图片消失如何解决先是图片文件上传$file=$_FILES['userfile'];  if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

图片消失怎么解决 图片消失怎么解决 Jun 13, 2016 am 10:09 AM

图片消失如何解决先是图片文件上传$file=$_FILES['userfile'];  if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'

为什么小弟我在php上写的这个代码,在浏览器上什么都不显示 为什么小弟我在php上写的这个代码,在浏览器上什么都不显示 Jun 13, 2016 am 10:24 AM

为什么我在php上写的这个代码,在浏览器上什么都不显示啊

See all articles