function get_flash_xml()
{
$flashdb = array();
if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml'))
{
// 兼容v2.7.0及以前版本
if
(!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/',
file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t,
PREG_SET_ORDER))
{
preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/',
file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t,
PREG_SET_ORDER);
}
if (!empty($t))
{
foreach ($t as $key => $val)
{
$val[4] = isset($val[4]) ? $val[4] : 0;
$flashdb[] = array('src'=>$val[1],'url'=>$val[2],'text'=>$val[3],'sort'=>$val[4]);
//print_r($flashdb);
}
}
}
return $flashdb;
}
转载于:https://my.oschina.net/bibo/blog/343065