devil6600 Posted November 30, 2009 Share Posted November 30, 2009 Hello, I am using curl to access a particular page and the result is the output as below. Can some one tell me how to read the below text into array? thanks Array ( [0] => Array ( [0] => 0111ec061058 [number] => 0111ec061058 [1] => UNIV [coll_name] => UNIV [2] => 7 [sem] => 7 [3] => KARLI DAVID [name] => KARLI DAVID [4] => yes [NAR1] => yes [5] => yes [NAR2] => yes [6] => yes [NAR3] => yes [7] => yes [NAR4] => yes [8] => yes [NAR5] => yes [9] => yes [NAR6] => yes [10] => no [NAR7] => no [11] => yes [NAR8] => yes [12] => [sub11] => [13] => [sub12] => [14] => [sub13] => [15] => [sub14] => [16] => [sub15] => [17] => [sub21] => [18] => [sub22] => [19] => [sub23] => [20] => [sub24] => [21] => [sub25] => [22] => [sub31] => [23] => [sub32] => [24] => [sub33] => [25] => [sub34] => [26] => [sub35] => [27] => [sub41] => [28] => [sub42] => [29] => [sub43] => [30] => [sub44] => [31] => [sub45] => [32] => [sub51] => [33] => [sub52] => [34] => [sub53] => [35] => [sub54] => [36] => [sub55] => [37] => [sub61] => [38] => [sub62] => [39] => [sub63] => [40] => [sub64] => [41] => [sub65] => [42] => CU [sub71] => CU [43] => CU [sub72] => CU [44] => CU [sub73] => CU [45] => CU [sub74] => CU [46] => CU [sub75] => CU [47] => [sub81] => [48] => [sub82] => [49] => [sub83] => [50] => [sub84] => [51] => [sub85] => [52] => [status1] => [53] => [status2] => [54] => [status3] => [55] => [status4] => [56] => [status5] => [57] => [status6] => [58] => RE [status7] => RE [59] => [status8] => [60] => BE [branch] => BE [61] => 6 [course] => 6 [62] => [result1] => [63] => [result2] => [64] => [result3] => [65] => [result4] => [66] => [result5] => [67] => [result6] => [68] => F [result7] => F [69] => [result8] => [70] => [result_de1] => [71] => [result_de2] => [72] => [result_de3] => [73] => [result_de4] => [74] => [result_de5] => [75] => [result_de6] => [76] => All Theory [result_de7] => All Theory [77] => [result_de8] => [78] => [result_des1] => [79] => [result_des2] => [80] => [result_des3] => [81] => [result_des4] => [82] => [result_des5] => [83] => [result_des6] => [84] => Fail in [result_des7] => Fail in [85] => [result_des8] => [86] => [gnd_total1] => [87] => [gnd_total2] => [88] => [gnd_total3] => [89] => [gnd_total4] => [90] => [gnd_total5] => [91] => [gnd_total6] => [92] => 382 [gnd_total7] => 382 [93] => [gnd_total8] => [94] => [set_total1] => [95] => [set_total2] => [96] => [set_total3] => [97] => [set_total4] => [98] => [set_total5] => [99] => [set_total6] => [100] => 160 [set_total7] => 160 [101] => [set_total8] => [102] => [pr_total1] => [103] => [pr_total2] => [104] => [pr_total3] => [105] => [pr_total4] => [106] => [pr_total5] => [107] => [pr_total6] => [108] => 150 [pr_total7] => 150 [109] => [pr_total8] => [110] => [thmid_total1] => [111] => [thmid_total2] => [112] => [thmid_total3] => [113] => [thmid_total4] => [114] => [thmid_total5] => [115] => [thmid_total6] => [116] => 72 [thmid_total7] => 72 [117] => [thmid_total8] => [118] => [th_total1] => [119] => [th_total2] => [120] => [th_total3] => [121] => [th_total4] => [122] => [th_total5] => [123] => [th_total6] => [124] => 0 [th_total7] => 0 [125] => [th_total8] => ) [1] => Array ( [0] => 0103ec061020 [number] => 0103ec061020 [1] => NCT [coll_name] => NCT [2] => 7 [sem] => 7 [3] => Ron MALIK [name] => RON MALIK [4] => yes [NAR1] => yes [5] => yes [NAR2] => yes [6] => yes [NAR3] => yes [7] => yes [NAR4] => yes [8] => yes [NAR5] => yes [9] => yes [NAR6] => yes [10] => no [NAR7] => no [11] => yes [NAR8] => yes [12] => [sub11] => [13] => [sub12] => [14] => [sub13] => [15] => [sub14] => [16] => [sub15] => [17] => [sub21] => [18] => [sub22] => [19] => [sub23] => [20] => [sub24] => [21] => [sub25] => [22] => [sub31] => [23] => [sub32] => [24] => [sub33] => [25] => [sub34] => [26] => [sub35] => [27] => [sub41] => [28] => [sub42] => [29] => [sub43] => [30] => [sub44] => [31] => [sub45] => [32] => [sub51] => [33] => [sub52] => [34] => [sub53] => [35] => [sub54] => [36] => [sub55] => [37] => [sub61] => [38] => [sub62] => [39] => [sub63] => [40] => [sub64] => [41] => [sub65] => [42] => 50 [sub71] => 50 [43] => 52 [sub72] => 52 [44] => 58 [sub73] => 58 [45] => 36 [sub74] => 36 [46] => 60 [sub75] => 60 [47] => [sub81] => [48] => [sub82] => [49] => [sub83] => [50] => [sub84] => [51] => [sub85] => [52] => [status1] => [53] => [status2] => [54] => [status3] => [55] => [status4] => [56] => [status5] => [57] => [status6] => [58] => RE [status7] => RE [59] => [status8] => [60] => BE [branch] => BE [61] => 6 [course] => 6 [62] => [result1] => [63] => [result2] => [64] => [result3] => [65] => [result4] => [66] => [result5] => [67] => [result6] => [68] => P [result7] => P [69] => [result8] => [70] => [result_de1] => [71] => [result_de2] => [72] => [result_de3] => [73] => [result_de4] => [74] => [result_de5] => [75] => [result_de6] => [76] => [result_de7] => [77] => [result_de8] => [78] => [result_des1] => [79] => [result_des2] => [80] => [result_des3] => [81] => [result_des4] => [82] => [result_des5] => [83] => [result_des6] => [84] => PASS [result_des7] => PASS [85] => [result_des8] => [86] => [gnd_total1] => [87] => [gnd_total2] => [88] => [gnd_total3] => [89] => [gnd_total4] => [90] => [gnd_total5] => [91] => [gnd_total6] => [92] => 696 [gnd_total7] => 696 [93] => [gnd_total8] => [94] => [set_total1] => [95] => [set_total2] => [96] => [set_total3] => [97] => [set_total4] => [98] => [set_total5] => [99] => [set_total6] => [100] => 172 [set_total7] => 172 [101] => [set_total8] => [102] => [pr_total1] => [103] => [pr_total2] => [104] => [pr_total3] => [105] => [pr_total4] => [106] => [pr_total5] => [107] => [pr_total6] => [108] => 184 [pr_total7] => 184 [109] => [pr_total8] => [110] => [thmid_total1] => [111] => [thmid_total2] => [112] => [thmid_total3] => [113] => [thmid_total4] => [114] => [thmid_total5] => [115] => [thmid_total6] => [116] => 84 [thmid_total7] => 84 [117] => [thmid_total8] => [118] => [th_total1] => [119] => [th_total2] => [120] => [th_total3] => [121] => [th_total4] => [122] => [th_total5] => [123] => [th_total6] => [124] => 256 [th_total7] => 256 [125] => [th_total8] => ) [2] => Array ( [0] => 0109ec061037 [number] => 0109ec061037 [1] => SSSI [coll_name] => SSSI [2] => 7 [sem] => 7 [3] => MIKE DEALER [name] => MIKE DEALER [4] => yes [NAR1] => yes [5] => yes [NAR2] => yes [6] => yes [NAR3] => yes [7] => yes [NAR4] => yes [8] => yes [NAR5] => yes [9] => yes [NAR6] => yes [10] => no [NAR7] => no [11] => yes [NAR8] => yes [12] => [sub11] => [13] => [sub12] => [14] => [sub13] => [15] => [sub14] => [16] => [sub15] => [17] => [sub21] => [18] => [sub22] => [19] => [sub23] => [20] => [sub24] => [21] => [sub25] => [22] => [sub31] => [23] => [sub32] => [24] => [sub33] => [25] => [sub34] => [26] => [sub35] => [27] => [sub41] => [28] => [sub42] => [29] => [sub43] => [30] => [sub44] => [31] => [sub45] => [32] => [sub51] => [33] => [sub52] => [34] => [sub53] => [35] => [sub54] => [36] => [sub55] => [37] => [sub61] => [38] => [sub62] => [39] => [sub63] => [40] => [sub64] => [41] => [sub65] => [42] => CU [sub71] => CU [43] => CU [sub72] => CU [44] => CU [sub73] => CU [45] => CU [sub74] => CU [46] => CU [sub75] => CU [47] => [sub81] => [48] => [sub82] => [49] => [sub83] => [50] => [sub84] => [51] => [sub85] => [52] => [status1] => [53] => [status2] => [54] => [status3] => [55] => [status4] => [56] => [status5] => [57] => [status6] => [58] => RE [status7] => RE [59] => [status8] => [60] => BE [branch] => BE [61] => 6 [course] => 6 [62] => [result1] => [63] => [result2] => [64] => [result3] => [65] => [result4] => [66] => [result5] => [67] => [result6] => [68] => F [result7] => F [69] => [result8] => [70] => [result_de1] => [71] => [result_de2] => [72] => [result_de3] => [73] => [result_de4] => [74] => [result_de5] => [75] => [result_de6] => [76] => All Theory [result_de7] => All Theory [77] => [result_de8] => [78] => [result_des1] => [79] => [result_des2] => [80] => [result_des3] => [81] => [result_des4] => [82] => [result_des5] => [83] => [result_des6] => [84] => Fail in [result_des7] => Fail in [85] => [result_des8] => [86] => [gnd_total1] => [87] => [gnd_total2] => [88] => [gnd_total3] => [89] => [gnd_total4] => [90] => [gnd_total5] => [91] => [gnd_total6] => [92] => 415 [gnd_total7] => 415 [93] => [gnd_total8] => [94] => [set_total1] => [95] => [set_total2] => [96] => [set_total3] => [97] => [set_total4] => [98] => [set_total5] => [99] => [set_total6] => [100] => 177 [set_total7] => 177 [101] => [set_total8] => [102] => [pr_total1] => [103] => [pr_total2] => [104] => [pr_total3] => [105] => [pr_total4] => [106] => [pr_total5] => [107] => [pr_total6] => [108] => 157 [pr_total7] => 157 [109] => [pr_total8] => [110] => [thmid_total1] => [111] => [thmid_total2] => [112] => [thmid_total3] => [113] => [thmid_total4] => [114] => [thmid_total5] => [115] => [thmid_total6] => [116] => 81 [thmid_total7] => 81 [117] => [thmid_total8] => [118] => [th_total1] => [119] => [th_total2] => [120] => [th_total3] => [121] => [th_total4] => [122] => [th_total5] => [123] => [th_total6] => [124] => 0 [th_total7] => 0 [125] => [th_total8] => ) ) Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/ Share on other sites More sharing options...
premiso Posted November 30, 2009 Share Posted November 30, 2009 According to what you posted, it is already an array....so the question is, did you word your question wrong? Can you provide a small of example of what you would like... Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968465 Share on other sites More sharing options...
salathe Posted November 30, 2009 Share Posted November 30, 2009 Is it literally that text? I only ask because it's an odd format to provide data in (for consumption). Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968467 Share on other sites More sharing options...
devil6600 Posted November 30, 2009 Author Share Posted November 30, 2009 Quote According to what you posted, it is already an array....so the question is, did you word your question wrong? Can you provide a small of example of what you would like... hello, thanks for your response, actually its a text... for example if i simply print smthing like this: echo "Array ( [0] => something..."; Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968468 Share on other sites More sharing options...
devil6600 Posted November 30, 2009 Author Share Posted November 30, 2009 Quote Is it literally that text? I only ask because it's an odd format to provide data in (for consumption). hello, thanks for your response, yes its text. Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968470 Share on other sites More sharing options...
salathe Posted November 30, 2009 Share Posted November 30, 2009 Perhaps this function may help, it looks like it might. Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968493 Share on other sites More sharing options...
devil6600 Posted December 1, 2009 Author Share Posted December 1, 2009 thanks salathe, it worked exactly what I want... awesome... Link to comment https://forums.phpfreaks.com/topic/183472-read-text-into-array/#findComment-968853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.