iscode
-
Posts
16 -
Joined
-
Last visited
Posts posted by iscode
-
-
No it wont wok on:
VI.data={"data1":"text1","data2":"text2","data3":"text3",data4:{text4a:1,text4b:1},"data5":"text5","data6":"text6","data7":"text7",data8:"text8"}};
-
Thank you
it worked for the first 4 data but not the last one
-
I have 4 more VI.data that your last function work on but only if I remove the spaces before and after =
// find all VI.* variables that have JSON
preg_match_all("~VI.([^\s]+) = (\[?{[^;]+}\]?)~is", $data, $matches); <-- Beforepreg_match_all("~VI.([^\s]+)=(\[?{[^;]+}\]?)~is", $data, $matches); <-- After
Is it possible somehow to remove those spaces if needed in the patern?
Then I have 1 more VI.data that does not work even though I remove the spaces before and after =
VI.data={"data1":"text1","data2":"text2","data3":"text3",data4:{text4a:1,text4b:1},"data5":"text5","data6":"text6","data7":"text7",data8:"text8"}}; -
Really awesome work you done here
but it wont take the data.aurora.idx into the array but everything else even on the quakeInfo page.
I think I do the setup correct though:
$data = file_get_contents('...
$VI = find_VI_json($data);
printf('<pre>%s</pre>', print_r($VI, true));
printf('<pre>%s</pre>', print_r($VI['data.aurora.idx'], true));
-
lol I think I have almost enough for few days now maybe one last question for now and hopefully if I have more problems I can bother you more
VI.data.aurora.text = { txt: 'Cloudy in the north. Fair in the south but gradually becoming overcast, mainly at the south coast. Likely the best places to see the sky in the southwest is the upcountry in west and then the upcountry in the south.', night: new Date(2014,1-1,8,0,0), valid_from: new Date(2014,1-1,8,20,0), valid_until: new Date(2014,1-1,9,4,0) };
btw, thank you for the link to the json_decode_nice function
-
You really make it look so simple
I really am trying to get my head into this but it will take me long time.
Do you think the next one is possible?
VI.imgConf[0] = {'title':'Total cloud cover','url':'total','0' : '/photos/ecm0125_island_tcc/140108_0000_3.png','tag0' : new Date(2014,1-1,8,3,0),'1' : '/photos/ecm0125_island_tcc/140108_0000_6.png','tag1' : new Date(2014,1-1,8,6,0),'2' : '/photos/ecm0125_island_tcc/140108_0000_9.png','tag2' : new Date(2014,1-1,8,9,0),'3' : '/photos/ecm0125_island_tcc/140108_0000_12.png','tag3' : new Date(2014,1-1,8,12,0),'4' : '/photos/ecm0125_island_tcc/140108_0000_15.png','tag4' : new Date(2014,1-1,8,15,0),'5' : '/photos/ecm0125_island_tcc/140108_0000_18.png','tag5' : new Date(2014,1-1,8,18,0),'6' : '/photos/ecm0125_island_tcc/140108_0000_21.png','tag6' : new Date(2014,1-1,8,21,0),'7' : '/photos/ecm0125_island_tcc/140108_0000_24.png','tag7' : new Date(2014,1-1,9,0,0),'8' : '/photos/ecm0125_island_tcc/140108_0000_27.png','tag8' : new Date(2014,1-1,9,3,0),'9' : '/photos/ecm0125_island_tcc/140108_0000_30.png','tag9' : new Date(2014,1-1,9,6,0),'10' : '/photos/ecm0125_island_tcc/140108_0000_33.png','tag10' : new Date(2014,1-1,9,9,0),'11' : '/photos/ecm0125_island_tcc/140108_0000_36.png','tag11' : new Date(2014,1-1,9,12,0),'12' : '/photos/ecm0125_island_tcc/140108_0000_39.png','tag12' : new Date(2014,1-1,9,15,0),'13' : '/photos/ecm0125_island_tcc/140108_0000_42.png','tag13' : new Date(2014,1-1,9,18,0),'14' : '/photos/ecm0125_island_tcc/140108_0000_45.png','tag14' : new Date(2014,1-1,9,21,0),'15' : '/photos/ecm0125_island_tcc/140108_0000_48.png','tag15' : new Date(2014,1-1,10,0,0),'16' : '/photos/ecm0125_island_tcc/140108_0000_51.png','tag16' : new Date(2014,1-1,10,3,0),'17' : '/photos/ecm0125_island_tcc/140108_0000_54.png','tag17' : new Date(2014,1-1,10,6,0),'18' : '/photos/ecm0125_island_tcc/140108_0000_57.png','tag18' : new Date(2014,1-1,10,9,0),'19' : '/photos/ecm0125_island_tcc/140108_0000_60.png','tag19' : new Date(2014,1-1,10,12,0),'20' : '/photos/ecm0125_island_tcc/140108_0000_66.png','tag20' : new Date(2014,1-1,10,18,0),'21' : '/photos/ecm0125_island_tcc/140108_0000_72.png','tag21' : new Date(2014,1-1,11,0,0),'22' : '/photos/ecm0125_island_tcc/140108_0000_78.png','tag22' : new Date(2014,1-1,11,6,0),'23' : '/photos/ecm0125_island_tcc/140108_0000_84.png','tag23' : new Date(2014,1-1,11,12,0),'24' : '/photos/ecm0125_island_tcc/140108_0000_90.png','tag24' : new Date(2014,1-1,11,18,0),'25' : '/photos/ecm0125_island_tcc/140108_0000_96.png','tag25' : new Date(2014,1-1,12,0,0),'26' : '/photos/ecm0125_island_tcc/140108_0000_102.png','tag26' : new Date(2014,1-1,12,6,0),'27' : '/photos/ecm0125_island_tcc/140108_0000_108.png','tag27' : new Date(2014,1-1,12,12,0),'28' : '/photos/ecm0125_island_tcc/140108_0000_114.png','tag28' : new Date(2014,1-1,12,18,0),'29' : '/photos/ecm0125_island_tcc/140108_0000_120.png','tag29' : new Date(2014,1-1,13,0,0),'30' : '/photos/ecm0125_island_tcc/140108_0000_126.png','tag30' : new Date(2014,1-1,13,6,0),'31' : '/photos/ecm0125_island_tcc/140108_0000_132.png','tag31' : new Date(2014,1-1,13,12,0),'32' : '/photos/ecm0125_island_tcc/140108_0000_138.png','tag32' : new Date(2014,1-1,13,18,0),'33' : '/photos/ecm0125_island_tcc/140108_0000_144.png','tag33' : new Date(2014,1-1,14,0,0),'34' : '/photos/ecm0125_island_tcc/140108_0000_150.png','tag34' : new Date(2014,1-1,14,6,0),'35' : '/photos/ecm0125_island_tcc/140108_0000_156.png','tag35' : new Date(2014,1-1,14,12,0),'36' : '/photos/ecm0125_island_tcc/140108_0000_162.png','tag36' : new Date(2014,1-1,14,18,0),'37' : '/photos/ecm0125_island_tcc/140108_0000_168.png','tag37' : new Date(2014,1-1,15,0,0),'38' : '/photos/ecm0125_island_tcc/140108_0000_174.png','tag38' : new Date(2014,1-1,15,6,0),'39' : '/photos/ecm0125_island_tcc/140108_0000_180.png','tag39' : new Date(2014,1-1,15,12,0),'40' : '/photos/ecm0125_island_tcc/140108_0000_186.png','tag40' : new Date(2014,1-1,15,18,0),'41' : '/photos/ecm0125_island_tcc/140108_0000_192.png','tag41' : new Date(2014,1-1,16,0,0),'42' : '/photos/ecm0125_island_tcc/140108_0000_198.png','tag42' : new Date(2014,1-1,16,6,0),'43' : '/photos/ecm0125_island_tcc/140108_0000_204.png','tag43' : new Date(2014,1-1,16,12,0),'44' : '/photos/ecm0125_island_tcc/140108_0000_210.png','tag44' : new Date(2014,1-1,16,18,0),'45' : '/photos/ecm0125_island_tcc/140108_0000_216.png','tag45' : new Date(2014,1-1,17,0,0),'46' : '/photos/ecm0125_island_tcc/140108_0000_222.png','tag46' : new Date(2014,1-1,17,6,0),'47' : '/photos/ecm0125_island_tcc/140108_0000_228.png','tag47' : new Date(2014,1-1,17,12,0),'48' : '/photos/ecm0125_island_tcc/140108_0000_234.png','tag48' : new Date(2014,1-1,17,18,0),'49' : '/photos/ecm0125_island_tcc/140108_0000_240.png','tag49' : new Date(2014,1-1,18,0,0),'mapCtrl':null };VI.imgConf[1] = {'title':'Lower clouds','url':'lower','0' : '/photos/ecm0125_island_lcc/140108_0000_3.png','tag0' : new Date(2014,1-1,8,3,0),'1' : '/photos/ecm0125_island_lcc/140108_0000_6.png','tag1' : new Date(2014,1-1,8,6,0),'2' : '/photos/ecm0125_island_lcc/140108_0000_9.png','tag2' : new Date(2014,1-1,8,9,0),'3' : '/photos/ecm0125_island_lcc/140108_0000_12.png','tag3' : new Date(2014,1-1,8,12,0),'4' : '/photos/ecm0125_island_lcc/140108_0000_15.png','tag4' : new Date(2014,1-1,8,15,0),'5' : '/photos/ecm0125_island_lcc/140108_0000_18.png','tag5' : new Date(2014,1-1,8,18,0),'6' : '/photos/ecm0125_island_lcc/140108_0000_21.png','tag6' : new Date(2014,1-1,8,21,0),'7' : '/photos/ecm0125_island_lcc/140108_0000_24.png','tag7' : new Date(2014,1-1,9,0,0),'8' : '/photos/ecm0125_island_lcc/140108_0000_27.png','tag8' : new Date(2014,1-1,9,3,0),'9' : '/photos/ecm0125_island_lcc/140108_0000_30.png','tag9' : new Date(2014,1-1,9,6,0),'10' : '/photos/ecm0125_island_lcc/140108_0000_33.png','tag10' : new Date(2014,1-1,9,9,0),'11' : '/photos/ecm0125_island_lcc/140108_0000_36.png','tag11' : new Date(2014,1-1,9,12,0),'12' : '/photos/ecm0125_island_lcc/140108_0000_39.png','tag12' : new Date(2014,1-1,9,15,0),'13' : '/photos/ecm0125_island_lcc/140108_0000_42.png','tag13' : new Date(2014,1-1,9,18,0),'14' : '/photos/ecm0125_island_lcc/140108_0000_45.png','tag14' : new Date(2014,1-1,9,21,0),'15' : '/photos/ecm0125_island_lcc/140108_0000_48.png','tag15' : new Date(2014,1-1,10,0,0),'16' : '/photos/ecm0125_island_lcc/140108_0000_51.png','tag16' : new Date(2014,1-1,10,3,0),'17' : '/photos/ecm0125_island_lcc/140108_0000_54.png','tag17' : new Date(2014,1-1,10,6,0),'18' : '/photos/ecm0125_island_lcc/140108_0000_57.png','tag18' : new Date(2014,1-1,10,9,0),'19' : '/photos/ecm0125_island_lcc/140108_0000_60.png','tag19' : new Date(2014,1-1,10,12,0),'20' : '/photos/ecm0125_island_lcc/140108_0000_66.png','tag20' : new Date(2014,1-1,10,18,0),'21' : '/photos/ecm0125_island_lcc/140108_0000_72.png','tag21' : new Date(2014,1-1,11,0,0),'22' : '/photos/ecm0125_island_lcc/140108_0000_78.png','tag22' : new Date(2014,1-1,11,6,0),'23' : '/photos/ecm0125_island_lcc/140108_0000_84.png','tag23' : new Date(2014,1-1,11,12,0),'24' : '/photos/ecm0125_island_lcc/140108_0000_90.png','tag24' : new Date(2014,1-1,11,18,0),'25' : '/photos/ecm0125_island_lcc/140108_0000_96.png','tag25' : new Date(2014,1-1,12,0,0),'26' : '/photos/ecm0125_island_lcc/140108_0000_102.png','tag26' : new Date(2014,1-1,12,6,0),'27' : '/photos/ecm0125_island_lcc/140108_0000_108.png','tag27' : new Date(2014,1-1,12,12,0),'28' : '/photos/ecm0125_island_lcc/140108_0000_114.png','tag28' : new Date(2014,1-1,12,18,0),'29' : '/photos/ecm0125_island_lcc/140108_0000_120.png','tag29' : new Date(2014,1-1,13,0,0),'30' : '/photos/ecm0125_island_lcc/140108_0000_126.png','tag30' : new Date(2014,1-1,13,6,0),'31' : '/photos/ecm0125_island_lcc/140108_0000_132.png','tag31' : new Date(2014,1-1,13,12,0),'32' : '/photos/ecm0125_island_lcc/140108_0000_138.png','tag32' : new Date(2014,1-1,13,18,0),'33' : '/photos/ecm0125_island_lcc/140108_0000_144.png','tag33' : new Date(2014,1-1,14,0,0),'34' : '/photos/ecm0125_island_lcc/140108_0000_150.png','tag34' : new Date(2014,1-1,14,6,0),'35' : '/photos/ecm0125_island_lcc/140108_0000_156.png','tag35' : new Date(2014,1-1,14,12,0),'36' : '/photos/ecm0125_island_lcc/140108_0000_162.png','tag36' : new Date(2014,1-1,14,18,0),'37' : '/photos/ecm0125_island_lcc/140108_0000_168.png','tag37' : new Date(2014,1-1,15,0,0),'38' : '/photos/ecm0125_island_lcc/140108_0000_174.png','tag38' : new Date(2014,1-1,15,6,0),'39' : '/photos/ecm0125_island_lcc/140108_0000_180.png','tag39' : new Date(2014,1-1,15,12,0),'40' : '/photos/ecm0125_island_lcc/140108_0000_186.png','tag40' : new Date(2014,1-1,15,18,0),'41' : '/photos/ecm0125_island_lcc/140108_0000_192.png','tag41' : new Date(2014,1-1,16,0,0),'42' : '/photos/ecm0125_island_lcc/140108_0000_198.png','tag42' : new Date(2014,1-1,16,6,0),'43' : '/photos/ecm0125_island_lcc/140108_0000_204.png','tag43' : new Date(2014,1-1,16,12,0),'44' : '/photos/ecm0125_island_lcc/140108_0000_210.png','tag44' : new Date(2014,1-1,16,18,0),'45' : '/photos/ecm0125_island_lcc/140108_0000_216.png','tag45' : new Date(2014,1-1,17,0,0),'46' : '/photos/ecm0125_island_lcc/140108_0000_222.png','tag46' : new Date(2014,1-1,17,6,0),'47' : '/photos/ecm0125_island_lcc/140108_0000_228.png','tag47' : new Date(2014,1-1,17,12,0),'48' : '/photos/ecm0125_island_lcc/140108_0000_234.png','tag48' : new Date(2014,1-1,17,18,0),'49' : '/photos/ecm0125_island_lcc/140108_0000_240.png','tag49' : new Date(2014,1-1,18,0,0),'mapCtrl':null };VI.imgConf[2] = {'title':'Middle clouds','url':'middle','0' : '/photos/ecm0125_island_mcc/140108_0000_3.png','tag0' : new Date(2014,1-1,8,3,0),'1' : '/photos/ecm0125_island_mcc/140108_0000_6.png','tag1' : new Date(2014,1-1,8,6,0),'2' : '/photos/ecm0125_island_mcc/140108_0000_9.png','tag2' : new Date(2014,1-1,8,9,0),'3' : '/photos/ecm0125_island_mcc/140108_0000_12.png','tag3' : new Date(2014,1-1,8,12,0),'4' : '/photos/ecm0125_island_mcc/140108_0000_15.png','tag4' : new Date(2014,1-1,8,15,0),'5' : '/photos/ecm0125_island_mcc/140108_0000_18.png','tag5' : new Date(2014,1-1,8,18,0),'6' : '/photos/ecm0125_island_mcc/140108_0000_21.png','tag6' : new Date(2014,1-1,8,21,0),'7' : '/photos/ecm0125_island_mcc/140108_0000_24.png','tag7' : new Date(2014,1-1,9,0,0),'8' : '/photos/ecm0125_island_mcc/140108_0000_27.png','tag8' : new Date(2014,1-1,9,3,0),'9' : '/photos/ecm0125_island_mcc/140108_0000_30.png','tag9' : new Date(2014,1-1,9,6,0),'10' : '/photos/ecm0125_island_mcc/140108_0000_33.png','tag10' : new Date(2014,1-1,9,9,0),'11' : '/photos/ecm0125_island_mcc/140108_0000_36.png','tag11' : new Date(2014,1-1,9,12,0),'12' : '/photos/ecm0125_island_mcc/140108_0000_39.png','tag12' : new Date(2014,1-1,9,15,0),'13' : '/photos/ecm0125_island_mcc/140108_0000_42.png','tag13' : new Date(2014,1-1,9,18,0),'14' : '/photos/ecm0125_island_mcc/140108_0000_45.png','tag14' : new Date(2014,1-1,9,21,0),'15' : '/photos/ecm0125_island_mcc/140108_0000_48.png','tag15' : new Date(2014,1-1,10,0,0),'16' : '/photos/ecm0125_island_mcc/140108_0000_51.png','tag16' : new Date(2014,1-1,10,3,0),'17' : '/photos/ecm0125_island_mcc/140108_0000_54.png','tag17' : new Date(2014,1-1,10,6,0),'18' : '/photos/ecm0125_island_mcc/140108_0000_57.png','tag18' : new Date(2014,1-1,10,9,0),'19' : '/photos/ecm0125_island_mcc/140108_0000_60.png','tag19' : new Date(2014,1-1,10,12,0),'20' : '/photos/ecm0125_island_mcc/140108_0000_66.png','tag20' : new Date(2014,1-1,10,18,0),'21' : '/photos/ecm0125_island_mcc/140108_0000_72.png','tag21' : new Date(2014,1-1,11,0,0),'22' : '/photos/ecm0125_island_mcc/140108_0000_78.png','tag22' : new Date(2014,1-1,11,6,0),'23' : '/photos/ecm0125_island_mcc/140108_0000_84.png','tag23' : new Date(2014,1-1,11,12,0),'24' : '/photos/ecm0125_island_mcc/140108_0000_90.png','tag24' : new Date(2014,1-1,11,18,0),'25' : '/photos/ecm0125_island_mcc/140108_0000_96.png','tag25' : new Date(2014,1-1,12,0,0),'26' : '/photos/ecm0125_island_mcc/140108_0000_102.png','tag26' : new Date(2014,1-1,12,6,0),'27' : '/photos/ecm0125_island_mcc/140108_0000_108.png','tag27' : new Date(2014,1-1,12,12,0),'28' : '/photos/ecm0125_island_mcc/140108_0000_114.png','tag28' : new Date(2014,1-1,12,18,0),'29' : '/photos/ecm0125_island_mcc/140108_0000_120.png','tag29' : new Date(2014,1-1,13,0,0),'30' : '/photos/ecm0125_island_mcc/140108_0000_126.png','tag30' : new Date(2014,1-1,13,6,0),'31' : '/photos/ecm0125_island_mcc/140108_0000_132.png','tag31' : new Date(2014,1-1,13,12,0),'32' : '/photos/ecm0125_island_mcc/140108_0000_138.png','tag32' : new Date(2014,1-1,13,18,0),'33' : '/photos/ecm0125_island_mcc/140108_0000_144.png','tag33' : new Date(2014,1-1,14,0,0),'34' : '/photos/ecm0125_island_mcc/140108_0000_150.png','tag34' : new Date(2014,1-1,14,6,0),'35' : '/photos/ecm0125_island_mcc/140108_0000_156.png','tag35' : new Date(2014,1-1,14,12,0),'36' : '/photos/ecm0125_island_mcc/140108_0000_162.png','tag36' : new Date(2014,1-1,14,18,0),'37' : '/photos/ecm0125_island_mcc/140108_0000_168.png','tag37' : new Date(2014,1-1,15,0,0),'38' : '/photos/ecm0125_island_mcc/140108_0000_174.png','tag38' : new Date(2014,1-1,15,6,0),'39' : '/photos/ecm0125_island_mcc/140108_0000_180.png','tag39' : new Date(2014,1-1,15,12,0),'40' : '/photos/ecm0125_island_mcc/140108_0000_186.png','tag40' : new Date(2014,1-1,15,18,0),'41' : '/photos/ecm0125_island_mcc/140108_0000_192.png','tag41' : new Date(2014,1-1,16,0,0),'42' : '/photos/ecm0125_island_mcc/140108_0000_198.png','tag42' : new Date(2014,1-1,16,6,0),'43' : '/photos/ecm0125_island_mcc/140108_0000_204.png','tag43' : new Date(2014,1-1,16,12,0),'44' : '/photos/ecm0125_island_mcc/140108_0000_210.png','tag44' : new Date(2014,1-1,16,18,0),'45' : '/photos/ecm0125_island_mcc/140108_0000_216.png','tag45' : new Date(2014,1-1,17,0,0),'46' : '/photos/ecm0125_island_mcc/140108_0000_222.png','tag46' : new Date(2014,1-1,17,6,0),'47' : '/photos/ecm0125_island_mcc/140108_0000_228.png','tag47' : new Date(2014,1-1,17,12,0),'48' : '/photos/ecm0125_island_mcc/140108_0000_234.png','tag48' : new Date(2014,1-1,17,18,0),'49' : '/photos/ecm0125_island_mcc/140108_0000_240.png','tag49' : new Date(2014,1-1,18,0,0),'mapCtrl':null };VI.imgConf[3] = {'title':'High clouds','url':'high','0' : '/photos/ecm0125_island_hcc/140108_0000_3.png','tag0' : new Date(2014,1-1,8,3,0),'1' : '/photos/ecm0125_island_hcc/140108_0000_6.png','tag1' : new Date(2014,1-1,8,6,0),'2' : '/photos/ecm0125_island_hcc/140108_0000_9.png','tag2' : new Date(2014,1-1,8,9,0),'3' : '/photos/ecm0125_island_hcc/140108_0000_12.png','tag3' : new Date(2014,1-1,8,12,0),'4' : '/photos/ecm0125_island_hcc/140108_0000_15.png','tag4' : new Date(2014,1-1,8,15,0),'5' : '/photos/ecm0125_island_hcc/140108_0000_18.png','tag5' : new Date(2014,1-1,8,18,0),'6' : '/photos/ecm0125_island_hcc/140108_0000_21.png','tag6' : new Date(2014,1-1,8,21,0),'7' : '/photos/ecm0125_island_hcc/140108_0000_24.png','tag7' : new Date(2014,1-1,9,0,0),'8' : '/photos/ecm0125_island_hcc/140108_0000_27.png','tag8' : new Date(2014,1-1,9,3,0),'9' : '/photos/ecm0125_island_hcc/140108_0000_30.png','tag9' : new Date(2014,1-1,9,6,0),'10' : '/photos/ecm0125_island_hcc/140108_0000_33.png','tag10' : new Date(2014,1-1,9,9,0),'11' : '/photos/ecm0125_island_hcc/140108_0000_36.png','tag11' : new Date(2014,1-1,9,12,0),'12' : '/photos/ecm0125_island_hcc/140108_0000_39.png','tag12' : new Date(2014,1-1,9,15,0),'13' : '/photos/ecm0125_island_hcc/140108_0000_42.png','tag13' : new Date(2014,1-1,9,18,0),'14' : '/photos/ecm0125_island_hcc/140108_0000_45.png','tag14' : new Date(2014,1-1,9,21,0),'15' : '/photos/ecm0125_island_hcc/140108_0000_48.png','tag15' : new Date(2014,1-1,10,0,0),'16' : '/photos/ecm0125_island_hcc/140108_0000_51.png','tag16' : new Date(2014,1-1,10,3,0),'17' : '/photos/ecm0125_island_hcc/140108_0000_54.png','tag17' : new Date(2014,1-1,10,6,0),'18' : '/photos/ecm0125_island_hcc/140108_0000_57.png','tag18' : new Date(2014,1-1,10,9,0),'19' : '/photos/ecm0125_island_hcc/140108_0000_60.png','tag19' : new Date(2014,1-1,10,12,0),'20' : '/photos/ecm0125_island_hcc/140108_0000_66.png','tag20' : new Date(2014,1-1,10,18,0),'21' : '/photos/ecm0125_island_hcc/140108_0000_72.png','tag21' : new Date(2014,1-1,11,0,0),'22' : '/photos/ecm0125_island_hcc/140108_0000_78.png','tag22' : new Date(2014,1-1,11,6,0),'23' : '/photos/ecm0125_island_hcc/140108_0000_84.png','tag23' : new Date(2014,1-1,11,12,0),'24' : '/photos/ecm0125_island_hcc/140108_0000_90.png','tag24' : new Date(2014,1-1,11,18,0),'25' : '/photos/ecm0125_island_hcc/140108_0000_96.png','tag25' : new Date(2014,1-1,12,0,0),'26' : '/photos/ecm0125_island_hcc/140108_0000_102.png','tag26' : new Date(2014,1-1,12,6,0),'27' : '/photos/ecm0125_island_hcc/140108_0000_108.png','tag27' : new Date(2014,1-1,12,12,0),'28' : '/photos/ecm0125_island_hcc/140108_0000_114.png','tag28' : new Date(2014,1-1,12,18,0),'29' : '/photos/ecm0125_island_hcc/140108_0000_120.png','tag29' : new Date(2014,1-1,13,0,0),'30' : '/photos/ecm0125_island_hcc/140108_0000_126.png','tag30' : new Date(2014,1-1,13,6,0),'31' : '/photos/ecm0125_island_hcc/140108_0000_132.png','tag31' : new Date(2014,1-1,13,12,0),'32' : '/photos/ecm0125_island_hcc/140108_0000_138.png','tag32' : new Date(2014,1-1,13,18,0),'33' : '/photos/ecm0125_island_hcc/140108_0000_144.png','tag33' : new Date(2014,1-1,14,0,0),'34' : '/photos/ecm0125_island_hcc/140108_0000_150.png','tag34' : new Date(2014,1-1,14,6,0),'35' : '/photos/ecm0125_island_hcc/140108_0000_156.png','tag35' : new Date(2014,1-1,14,12,0),'36' : '/photos/ecm0125_island_hcc/140108_0000_162.png','tag36' : new Date(2014,1-1,14,18,0),'37' : '/photos/ecm0125_island_hcc/140108_0000_168.png','tag37' : new Date(2014,1-1,15,0,0),'38' : '/photos/ecm0125_island_hcc/140108_0000_174.png','tag38' : new Date(2014,1-1,15,6,0),'39' : '/photos/ecm0125_island_hcc/140108_0000_180.png','tag39' : new Date(2014,1-1,15,12,0),'40' : '/photos/ecm0125_island_hcc/140108_0000_186.png','tag40' : new Date(2014,1-1,15,18,0),'41' : '/photos/ecm0125_island_hcc/140108_0000_192.png','tag41' : new Date(2014,1-1,16,0,0),'42' : '/photos/ecm0125_island_hcc/140108_0000_198.png','tag42' : new Date(2014,1-1,16,6,0),'43' : '/photos/ecm0125_island_hcc/140108_0000_204.png','tag43' : new Date(2014,1-1,16,12,0),'44' : '/photos/ecm0125_island_hcc/140108_0000_210.png','tag44' : new Date(2014,1-1,16,18,0),'45' : '/photos/ecm0125_island_hcc/140108_0000_216.png','tag45' : new Date(2014,1-1,17,0,0),'46' : '/photos/ecm0125_island_hcc/140108_0000_222.png','tag46' : new Date(2014,1-1,17,6,0),'47' : '/photos/ecm0125_island_hcc/140108_0000_228.png','tag47' : new Date(2014,1-1,17,12,0),'48' : '/photos/ecm0125_island_hcc/140108_0000_234.png','tag48' : new Date(2014,1-1,17,18,0),'49' : '/photos/ecm0125_island_hcc/140108_0000_240.png','tag49' : new Date(2014,1-1,18,0,0),'mapCtrl':null };VI.imgConf[4] = {'title':'Composite','url':'composite','0' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_3.png','tag0' : new Date(2014,1-1,8,3,0),'1' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_6.png','tag1' : new Date(2014,1-1,8,6,0),'2' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_9.png','tag2' : new Date(2014,1-1,8,9,0),'3' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_12.png','tag3' : new Date(2014,1-1,8,12,0),'4' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_15.png','tag4' : new Date(2014,1-1,8,15,0),'5' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_18.png','tag5' : new Date(2014,1-1,8,18,0),'6' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_21.png','tag6' : new Date(2014,1-1,8,21,0),'7' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_24.png','tag7' : new Date(2014,1-1,9,0,0),'8' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_27.png','tag8' : new Date(2014,1-1,9,3,0),'9' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_30.png','tag9' : new Date(2014,1-1,9,6,0),'10' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_33.png','tag10' : new Date(2014,1-1,9,9,0),'11' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_36.png','tag11' : new Date(2014,1-1,9,12,0),'12' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_39.png','tag12' : new Date(2014,1-1,9,15,0),'13' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_42.png','tag13' : new Date(2014,1-1,9,18,0),'14' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_45.png','tag14' : new Date(2014,1-1,9,21,0),'15' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_48.png','tag15' : new Date(2014,1-1,10,0,0),'16' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_51.png','tag16' : new Date(2014,1-1,10,3,0),'17' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_54.png','tag17' : new Date(2014,1-1,10,6,0),'18' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_57.png','tag18' : new Date(2014,1-1,10,9,0),'19' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_60.png','tag19' : new Date(2014,1-1,10,12,0),'20' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_66.png','tag20' : new Date(2014,1-1,10,18,0),'21' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_72.png','tag21' : new Date(2014,1-1,11,0,0),'22' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_78.png','tag22' : new Date(2014,1-1,11,6,0),'23' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_84.png','tag23' : new Date(2014,1-1,11,12,0),'24' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_90.png','tag24' : new Date(2014,1-1,11,18,0),'25' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_96.png','tag25' : new Date(2014,1-1,12,0,0),'26' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_102.png','tag26' : new Date(2014,1-1,12,6,0),'27' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_108.png','tag27' : new Date(2014,1-1,12,12,0),'28' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_114.png','tag28' : new Date(2014,1-1,12,18,0),'29' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_120.png','tag29' : new Date(2014,1-1,13,0,0),'30' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_126.png','tag30' : new Date(2014,1-1,13,6,0),'31' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_132.png','tag31' : new Date(2014,1-1,13,12,0),'32' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_138.png','tag32' : new Date(2014,1-1,13,18,0),'33' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_144.png','tag33' : new Date(2014,1-1,14,0,0),'34' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_150.png','tag34' : new Date(2014,1-1,14,6,0),'35' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_156.png','tag35' : new Date(2014,1-1,14,12,0),'36' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_162.png','tag36' : new Date(2014,1-1,14,18,0),'37' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_168.png','tag37' : new Date(2014,1-1,15,0,0),'38' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_174.png','tag38' : new Date(2014,1-1,15,6,0),'39' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_180.png','tag39' : new Date(2014,1-1,15,12,0),'40' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_186.png','tag40' : new Date(2014,1-1,15,18,0),'41' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_192.png','tag41' : new Date(2014,1-1,16,0,0),'42' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_198.png','tag42' : new Date(2014,1-1,16,6,0),'43' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_204.png','tag43' : new Date(2014,1-1,16,12,0),'44' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_210.png','tag44' : new Date(2014,1-1,16,18,0),'45' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_216.png','tag45' : new Date(2014,1-1,17,0,0),'46' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_222.png','tag46' : new Date(2014,1-1,17,6,0),'47' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_228.png','tag47' : new Date(2014,1-1,17,12,0),'48' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_234.png','tag48' : new Date(2014,1-1,17,18,0),'49' : '/photos/ecm0125_island_tcc_lcc_mcc_hcc/140108_0000_240.png','tag49' : new Date(2014,1-1,18,0,0),'mapCtrl':null };
-
I have problem creating patern with preg_match_all and add it to array,
its involved json data, Ch0cu3r helped me alot with my previous
question http://forums.phpfreaks.com/topic/285059-preg-match-all-problem/,
maybe he is still around?
VI.data.aurora.idx = {140108: {act: 3,
sun: ['s0','16:00','11:08','17:12','09:56'],
moon: ['7','t3','03:51','']},
140109: {act: 2,
sun: ['s0','16:02','11:06','17:14','09:55'],
moon: ['8','t3','05:12','']},
140110: {act: 2,
sun: ['s0','16:05','11:04','17:16','09:54'],
moon: ['9','t3','06:28','']},
140111: {act: 3,
sun: ['s0','16:08','11:02','17:18','09:52'],
moon: ['10','t3','07:35','']},
140112: {act: 2,
sun: ['s0','16:11','11:00','17:20','09:51'],
moon: ['11','t3','08:30','']},
140113: {act: 2,
sun: ['s0','16:14','10:57','17:23','09:49'],
moon: ['12','t3','09:11','']},
140114: {act: 2,
sun: ['s0','16:17','10:55','17:25','09:48'],
moon: ['13','t3','09:41','']},
140115: {act: 2,
sun: ['s0','16:20','10:53','17:27','09:46'],
moon: ['14','t4','16:33','10:03']},
140116: {act: 2,
sun: ['s0','16:23','10:50','17:30','09:44'],
moon: ['15','t4','17:46','10:18']},
140117: {act: 2,
sun: ['s0','16:26','10:48','17:32','09:42'],
moon: ['16','t4','19:03','10:30']}} -
Ch0cu3r
Thank you for all the help
-
foreach($quakeInfo as $region => $regionData) { echo "<h1>$region</h1>"; foreach($regionData as $quake) { // convert timestamp to english readable format echo date('F j, Y, g:i a', $quake['t']); } }
The abow code display the data as group, how would it be coded without group each data?
-
Can you decipher this date format for me, please? I'm not very smart.
new Date(2014,1-1,3,14,53,28)
2014 = Year
1-1 = month
3 = day
14 = hour
53 = minute
28 = seconds
-
Its working now, I really appreciate your help.
Do you know how I can split up the "new Date(2014,1-1,3,14,53,28)" to normal date and time format?
-
It wont work for some reason maybe its my preg_match_all patterns.
Can you maybe see what I am doing wrong?
<?php $html = file_get_contents('http://www.vedur.is/skjalftar-og-eldgos/jardskjalftar'); preg_match_all('@VI.quakeInfo =(.*?)</script>@si', $html, $m); preg_match_all('@{(.*?)}@si', $m[1][0], $data_array); $data = array(); foreach ($data_array[1] as $string) { // regex for finding keys $keyMatch = "#'(\w+)':#"; // match all keys preg_match_all($keyMatch, $string, $keys); // split string on keys $values = preg_split($keyMatch, $string); $values = array_filter($values); $values = array_map(function($value) { return trim($value, "',"); }, $values); printf('<pre>%s</pre>', print_r([$keys, $values], true)); // combine both arrays into key - value pairs $data = array_combine($keys[1], $values); unset($keys, $values); } printf('<pre>%s</pre>', print_r($data, true)); ?>
-
Sorry if I confuse you but what I mean is the $string is array like below
Array
(
[0] => Array
(
[0] => {'t':new Date(2014,1-1,3,14,53,28),'a':'2.10978','lat':'12,123','lon':'-12,123','dep':'0,6','s':'0,0','q':'37,96','dL':'6,9','dD':'ANA ','dR':'PlaceName'}
[1] => {'t':new Date(2014,1-1,3,9,35,38),'a':'7.40706','lat':'12,123','lon':'-12,123','dep':'1,1','s':'1,0','q':'90,02','dL':'4,3','dD':'VSV','dR':'PlaceName'}
)[1] => Array
(
[0] => 't':new Date(2014,1-1,3,14,53,28),'a':'2.10978','lat':'12,123','lon':'-12,123','dep':'0,6','s':'0,0','q':'37,96','dL':'6,9','dD':'ANA ','dR':'PlaceName'
[1] => 't':new Date(2014,1-1,3,9,35,38),'a':'7.40706','lat':'12,123','lon':'-12,123','dep':'1,1','s':'1,0','q':'90,02','dL':'4,3','dD':'VSV','dR':'PlaceName'
))
-
Thank you
but what if the $string is an array and I have to go through many $string?
-
I have the following string :
't':new Date(2014,1-1,3,9,35,38),'a':'3.57289','lat':'12,123','lon':'-12,123','dep':'1,1','s':'1,0','q':'90,02','dL':'4,3','dD':'VSV','dR':'PlaceName'
t=date and time
a=?
lat=latitude
lon=longitude
dep=depth
s=magnitude
q=quality
dL=?
dD=direction
dR=PlaceName
I am trying to get the data into array with preg_match_all
Can anyone help me out?
preg_match_all problem 2
in Regex Help
Posted · Edited by iscode
Ohh it must be my fault because I did a count for each { and } should be 13 each, I did try the function on the actual data but failed,
here is the actual VI.data: