Home  >  Article  >  Backend Development  >  列表解析 - python的列表字符串如何转换为php数组

列表解析 - python的列表字符串如何转换为php数组

WBOY
WBOYOriginal
2016-06-06 20:20:291591browse

有一个接口返回类似python列表的字符串 [a,b,c,d],有什么方法优雅的将其转换为php数组?

回复内容:

有一个接口返回类似python列表的字符串 [a,b,c,d],有什么方法优雅的将其转换为php数组?

跨语言的话,通过json为媒介。tuple和list都是数组,相比于php

通过json

Statement:
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