category as $category) { if($cat == convert($category{"dir"})){ $history_here = convert($category{"name"}); } } } else { $mode = "list"; foreach ($xml->category as $category) { if($cat == convert($category{"dir"})){ $history_parent = convert($category{"name"}); foreach ($category->product as $product) { if($id == convert($product{"id"})){ $history_here = convert($product{"name"}); } } } } } ?>
category as $category) { if($cat == convert($category{"dir"})){ $item = $category; $item = (array)$item; $product_arr = (array)$item{'product'}; $tmp = array(); foreach ($product_arr as $v) $tmp[] = $v['year']; array_multisort($tmp, SORT_DESC, SORT_NUMERIC, $product_arr); foreach ($product_arr as $product) { $product_name = convert($product{"name"}); $product_id = convert($product{"id"}); $product_year = convert($product{"year"}); $product_imgnum = convert($product{"num"}); if($product_imgnum > 3){ $imgnum = 3; } else { $imgnum = $product_imgnum; } print <<

{$product_name}

{$product_year}年

    end_of_xml; for($i = 0; $i < $imgnum; $i++){ $number = sprintf('%02d', $i + 1); print("
  • \"{$product_name}\"

  • \n"); } print <<
end_of_xml; } } } ?>
category as $category) { if($cat == convert($category{"dir"})){ foreach ($category->product as $product) { if($id == convert($product{"id"})){ $product_name = convert($product{"name"}); $product_id = convert($product{"id"}); $product_year = convert($product{"year"}); print <<

{$product_name}

{$product_year}年

    end_of_xml; for($i = 0; $i < $product{"num"}; $i++){ $number = sprintf('%02d', $i + 1); print("
  • \"{$product_name}\"

  • \n"); } print <<
end_of_xml; } } } } ?>