Array ( [0] => [[["15:30"," ","Alemania","Germany"," Bundesliga: ","Bayer Leverkusen - SC Freiburg"]]] [1] => [[["15:30"," ","Polonia","Poland"," Ekstraklasa: ","MKS Sandecja Nowy Sacz - Termalica Bruk-Bet Nieciecza"]]] [2] => [[["15:30"," ","Rusia","Russia"," Premier League: ","FC Rubin Kazan - FC Ural Yekaterinburg"]]] [3] => [[["16:00"," ","Albania","Albania"," Kategoria Superiore: ","KF Laci - Luftetari Gjirokaster"]]] [4] => [[["16:00"," ","Brasil","Brazil"," Brasileir\u00e3o Serie A: ","Avai SC - Atletico Mineiro MG"]]]
如何使用php从这个对象获取数据,例如我需要花时间并将其保存在变量中
答案 0 :(得分:1)
如果你需要时间
假设你有$ myArray
$myArray = Array ( [0] => [[["15:30"," ","Alemania","Germany"," Bundesliga: ","Bayer Leverkusen - SC Freiburg"]]]
[1] => [[["15:30"," ","Polonia","Poland"," Ekstraklasa: ","MKS Sandecja Nowy Sacz - Termalica Bruk-Bet Nieciecza"]]]
[2] => [[["15:30"," ","Rusia","Russia"," Premier League: ","FC Rubin Kazan - FC Ural Yekaterinburg"]]]
[3] => [[["16:00"," ","Albania","Albania"," Kategoria Superiore: ","KF Laci - Luftetari Gjirokaster"]]]
[4] => [[["16:00"," ","Brasil","Brazil"," Brasileir\u00e3o Serie A: ","Avai SC - Atletico Mineiro MG"]]] );
你可以使用
foreach ($myArray as $key => $value) {
$myTime[$key]= $value[0][0][0] ;
}
=只有一个只有时间的数组