PHP mysql代码帮助解码

标签 php asp.net mysql json

我的数据库中的项目下有这个值:

a:1:{i:0;a:9:{s:12:"model_number";s:10:"TT1-W";s:5:"price";s:4:"3810";s:10:"unit_price";d:3135.6300000000001091393642127513885498046875;s:8:"id_price";d:3810;s:9:"sales_tax";d:290.3700000000000045474735088646411895751953125;s:5:"sales";d:3084.6300000000001091393642127513885498046875;s:7:"service";s:2:"51";s:7:"freight";s:3:"384";s:13:"co_cat";s:3:"X4";}}

使其对读者更友好:

a:1:
    {
    i:0;
    a:9:
        {
        s:12:"model_number";
        s:10:"TT1-W";
        s:5:"price";
        s:4:"3810";
        s:10:"unit_price";
        d:3135.6300000000001091393642127513885498046875;
        s:8:"id_price";
        d:3810;
        s:9:"sales_tax";
        d:290.3700000000000045474735088646411895751953125;
        s:5:"sales";
        d:3084.6300000000001091393642127513885498046875;
        s:7:"service";
        s:2:"51";
        s:7:"freight";
        s:3:"384";
        s:13:"co_cat";
        s:3:"X4";
        }
    }

我无法找出如何解码这个字符串,因为它似乎无法在页面上显示它的 php 代码中找到对它的引用。在我看来它是 JSON,但我似乎无法找到上述格式的“标准”格式,以便开始弄清楚它的开始位置和结束位置。

我需要使用 ASP.net 对其进行解码。但话又说回来,我需要先弄清楚它是什么,然后才能开始解码!

任何帮助都会很棒!

最佳答案

尝试反序列化: function.unserialize

编辑:如果您可以使用 C# 库: How to unserialize PHP Serialized array/variable/class and return suitable object in C#

编辑2: Visual Studio Tip: Three ways to use C# within a VB.NET project

编辑3:

i need to figure out what it is

这是标准的 PHP 解决方案,用于在字符串中存储(和恢复)数组和对象(以及其他类型,参见手册)。

关于PHP mysql代码帮助解码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11942028/

相关文章:

c# - Redis 缓存 - 阻塞操作被 WSACancelBlockingCall 调用中断

mysql - 如何计算每位教师所教的学生数量而不包括重复的学生数量?

mysql - 用于将列值设置为与下一行的列值相同的 SQL

java - 连接字符串作为 GET/POST 请求的参数

php - 静态::对比self::- 有什么缺点吗?

c# - 如何将转发器绑定(bind)到自定义类的数组?

php - Cakephp 2.0 和基本认证

c# - FormulaR1C1 增加行值 EPPlus

php - 如何知道当前时间是否为夏令时?

javascript - jQuery 在单击时获取 href 中的 img src