您好我有一个格式为:
的文本文件ITEM SKU PRICE QTY SUBTOTAL Classic Flipbook
Design Name:
Frosted
Title:
Merry Christmas
Title 2:
Something
Title 3:
Files:
55c6155a19622: _20150711_200519.JPG
3x2 $18.00 1 $18.00 Classic Flipbook
Design Name:
Bouquet
Title:
Title 2:
Title 3:
something
Files:
55c6157ebb6b3: _20150712_070009.JPG
3x2 $18.00 1 $18.00 Subtotal $36.00 Sales Tax (9.25%) $3.96 Shipping &
Handling $6.62 Grand Total $46.58
我需要在格式化输出下面返回关联数组
Array
(
[0] => Array
(
[design] => Frosted
[title_1] => Merry Christmas
[title_2] => Something
[title_3] =>
[file_id] => 55c6155a19622
[file_name] => _20150711_200519.JPG
)
[1] => Array
(
[design] => Bouquet
[title_1] =>
[title_2] =>
[title_3] =>
[file_id] =>
[file_name] =>
)
)
注意:需要读取文件而不是像上面那样制作数组
答案 0 :(得分:0)
如果是你想要的格式化关联数组,那么试试这个:
$AssociatedArray = ['design' => (yourDesignInput), 'title_1' => (inputtedTitle1), 'title_2' => (inputtedTitle2), 'title_3' => (inputtedTitle3), 'file_id' => (inputtedFileID), 'file_name' => (inputtedFileName)];