如何将URL编码的JSON数组转换为PHP数组(How to convert URL encoded JSON array into PHP array)
如何将从我的Android应用程序发送的URL编码的JSON转换为PHP数组。当前格式我看起来像下面的格式。
[{\\\"product_id\\\":\\\"33\\\",\\\"amount\\\":\\\"1\\\"},{\\\"product_id\\\":\\\"34\\\",\\\"amount\\\":\\\"3\\\"},{\\\"product_id\\\":\\\"10\\\",\\\"amount\\\":\\\"1\\\"}]如何将这些数据转换为以下格式
product_id amount 33 1 34 3 10 1因为我想将这些数据插入到MySQL数据库中。任何人都可以帮我解决这个问题。
how can convert URL encoded JSON sent from my android application into PHP array.Current format i am getting looks like below format.
[{\\\"product_id\\\":\\\"33\\\",\\\"amount\\\":\\\"1\\\"},{\\\"product_id\\\":\\\"34\\\",\\\"amount\\\":\\\"3\\\"},{\\\"product_id\\\":\\\"10\\\",\\\"amount\\\":\\\"1\\\"}]How can i convert those data into below format
product_id amount 33 1 34 3 10 1Because i want to insert those data into MySQL database.Can anyone please help me regarding this problem.
原文:
更新时间:2022-03-29 19:03
最满意答案
相关问答
更多-
现在解决了。 我必须将RenderFormat值设置为“EXCEL”或“EXCELOPENXML” Solved it now. I had to put the RenderFormat value as "EXCEL" or "EXCELOPENXML"
-
根据我上面的评论回答: 它可能无法匹配您正在寻找的格式方法,因为它的签名是格式(String,Object []),并且您的第二个String参数不能自动转换为Object数组。 您可以更改参数以将名称封装在数组中,如下所示: format("Hello, %s!", [firstName]) 。 感谢Leigh如此有礼貌,我赞成你的意见:) Answer based on my comment above: It probably can't match the format method you're ...
-
Python 3 .format和List(Python 3 .format and List)[2022-02-17]
您可以使用* (单个星号)为您解开列表。 另请参阅: 解压缩列表 a = [1,2,3,4] print('a{0}\ta{3}\ta{1}\ta{2}'.format(*a)) You can use the *(single asterisk) to unpack the list for you. See also: Unpack a list a = [1,2,3,4] print('a{0}\ta{3}\ta{1}\ta{2}'.format(*a)) -
调用错误,保存Active Directory中的用户列表(Invocation error saving a list of users in Active Directory)[2021-12-04]
如果您正在使用模拟,则需要确保模拟用户具有足够的权限来修改/创建活动目录中的对象。 如果模拟用户不是域管理员或没有设置自定义权限,则几乎不会出现这种情况。 我建议你放弃模拟并将应用程序池作为域帐户运行,该帐户在活动目录中具有有限的权限(想想这里的最小权限,只给它完成工作所需的权限),或者在代码中创建一个模拟上下文手动使用与建议的应用程序池帐户具有相同限制的域帐户。 这个 SO答案中有几个链接可以帮助您在代码中模仿另一个用户。 Ok guys, i've finally made it! For some r ... -
你要找的东西叫做Variadic Function ,在Objective-C中你可以写下如下的东西: - (NSString *) stringWithFormat:(NSString ) format, ... { } 您可以使用Objective-C可变参数的这个极好的例子来获得更多细节。 What you're looking for is called a Variadic Function and in Objective-C you can write something like the ...
-
swift错误的String init(格式...方法?[复制](swift something wrong with String init(format… method? [duplicate])[2021-09-19]
使用此语法(XCode 7): import Foundation let elem1 = "1" let elem2 = "2" let format = "%@ != %@" let str = String(format: format, elem1, elem2) // "1 !=2" print(str) // "1 != 2\n" 诀窍是用格式指定重载的ctor:并跳过参数:all all。 Use this syntax (XCode 7): import Foundation let ... -
1.)文档似乎没有说明(至少我无法在任何地方找到它,尽管我最难搜索)如何访问它所说的系统提供的正确本地化的字符串。 这是如何完成的? 最直接的方法是使用其中一个静态get..Instance()方法(如getDateTimeInstance()来获取java.text.DateFormat对象。 返回的格式化程序将设置为适合当前系统区域设置。 在formatter对象上使用format()来获取格式化的字符串。 使用SimpleDateFormat通常也很容易。 2.)在上面的示例行中提供您自己的格式字符串 ...
-
目前列表API仅支持前缀查询,请参阅此处的查询参数文档。 尝试查询“email:someEmail@someDomain.com*” - >注意最后的星号。 Currently the list API supports only prefix queries, please refer to the documentation for query parameter here. Try with query as "email:someEmail@someDomain.com*" -> Note the ...
-
您正在寻找的预处理器是LabelBinarizer import pandas as pd import numpy as np from sklearn.preprocessing import LabelBinarizer data = [{'genres': ['comedy', 'horror']}, {'genres': ['action', 'documentary']}] df = pd.DataFrame(data) # explode the list to separate rows ...
-
Python:使用.format方法用列表项填充字符串(Python: using .format method to populate string with list items)[2022-06-28]
您只需解压缩列表即可: >>> x = [1, 2, 3, 4, 5] >>> 'The first 4 items in my list are {}, {}, {}, {}'.format(*x) 'The first 4 items in my list are 1, 2, 3, 4' >>> 任何剩余的参数都将被忽略。 You can simply unpack the list: >>> x = [1, 2, 3, 4, 5] >>> 'The first 4 items in my list ...