我正在设计一个购物车,它将允许用户以csv格式上传产品。问题是其中一列包含动态子列。解释这种情况的最好的方法是一个产品数据的一个示例:php csv动态列
stdClass Object
(
[id] => 412
[description] => this is the description for phat cars
[title] => Phat Cars
[price] => 2500.00
[custom] => Array
(
[custom_info] => Array
(
)
[custom_price] => Array
(
)
)
)
字段定制[custom_info]和定制[custom_price]可以包含任意数量的字段。我想不出一个解决方案,使用csv动态列,但认为我会抛出问题,看看有没有人有任何建议。
这不是一个好的解决方案,但可以使用多行。我主要只是为了将数据导出到CSV文件而做到这一点。 – AndrewR