0
因此,我正在一個Excel XML解析類,我試圖通過搜索文件的標題值的數組,以返回鍵整數。如果我可以得到鍵int,那麼我可以通過文件頭中的值獲取整列。我曾嘗試使用in_array,search_array和其他一些函數,但似乎沒有任何工作。這裏是陣列IM3與解析/搜索充滿簡單的xml對象的野獸陣列在PHP
array(30) { [0]=> array(1) { ["Data"]=> object(SimpleXMLElement)#37 (1) { [0]=> string(6) "Item #" } } [1]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#38 (0) { } } [2]=> array(1) { ["Data"]=> object(SimpleXMLElement)#39 (1) { [0]=> string(5) "Style" } } [3]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#40 (0) { } } [4]=> array(1) { ["Data"]=> object(SimpleXMLElement)#41 (1) { [0]=> string(5) "Brand" } } [5]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#42 (0) { } } [6]=> array(1) { ["Data"]=> object(SimpleXMLElement)#43 (1) { [0]=> string(5) "Color" } } [7]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#44 (0) { } } [8]=> array(1) { ["Data"]=> object(SimpleXMLElement)#45 (1) { [0]=> string(4) "Size" } } [9]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#46 (0) { } } [10]=> array(1) { ["Data"]=> object(SimpleXMLElement)#47 (1) { [0]=> string(12) "Active Price" } } [11]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#48 (0) { } } [12]=> array(1) { ["Data"]=> object(SimpleXMLElement)#49 (1) { [0]=> string(6) "Gender" } } [13]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#50 (0) { } } [14]=> array(1) { ["Data"]=> object(SimpleXMLElement)#51 (1) { [0]=> string(4) "Cost" } } [15]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#52 (0) { } } [16]=> array(1) { ["Data"]=> object(SimpleXMLElement)#53 (1) { [0]=> string(11) "On-hand Qty" } } [17]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#54 (0) { } } [18]=> array(1) { ["Data"]=> object(SimpleXMLElement)#55 (1) { [0]=> string(9) "Dept Name" } } [19]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#56 (0) { } } [20]=> array(1) { ["Data"]=> object(SimpleXMLElement)#57 (1) { [0]=> string(15) "Color Full Name" } } [21]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#58 (0) { } } [22]=> array(1) { ["Data"]=> object(SimpleXMLElement)#59 (1) { [0]=> string(8) "ItemType" } } [23]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#60 (0) { } } [24]=> array(1) { ["Data"]=> object(SimpleXMLElement)#61 (1) { [0]=> string(3) "UPC" } } [25]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#62 (0) { } } [26]=> array(1) { ["Data"]=> object(SimpleXMLElement)#63 (1) { [0]=> string(6) "UPCNEW" } } [27]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#64 (0) { } } [28]=> array(1) { ["Data"]=> object(SimpleXMLElement)#65 (1) { [0]=> string(3) "MPN" } } [29]=> array(1) { ["NamedCell"]=> object(SimpleXMLElement)#66 (0) { } } } array(1) { ["Data"]=> object(SimpleXMLElement)#37 (1) { [0]=> string(6) "Item #" } }
工作,所以雅基本上我只是想例如搜索「品牌」陣列中,以返回corrosponds品牌(2)
你爲什麼不使用像phpexcel這樣的現有庫的任何原因? – Gordon 2010-10-22 20:18:20