$value){
if(in_array($key,$hidden)){
echo "".$key." | ";
}else{
echo " |
".$key." | ";
}
$str_replace = str_replace(' ','_',$key);
echo (in_array($key,$name_rp)) ? " |
";
foreach($value as $k => $v){
//判斷群組是否要隱藏
if(in_array($key,$hidden)){
$num = explode(' ',$v);
echo "";
$row_title = (substr($num[0],0,1) == "#") ? substr($num[0],1):$num[0];
echo "".$row_title." | ";
//判斷是否可以重複新增
if(in_array($row_title,$name_rp)){
echo "";
$str_replace = str_replace(' ','_',$row_title);
echo "";
}
echo " | ";
echo "
";
}else{
$num = explode(' ',$v);
$row_title = (substr($num[0],0,1) == "#") ? substr($num[0],1):$num[0];
//判斷群組內的標題是否要隱藏
if(in_array($row_title,$hidden)){
}else{
echo "";
echo "".$row_title." | ";
//判斷是否可以重複新增
if(in_array($row_title,$name_rp)){
echo "";
$str_replace = str_replace(' ','_',$row_title);
echo "";
}
echo " | ";
echo "
";
}
}
}
}
//非群組設定
echo " | |
";
$length = count($filename);
for($i=0; $i < $length; $i++){
//取下一筆資料,並去掉有#字號的標題
$next = next($filename);
$next_title = (substr($next,0,1) == "#") ? substr($next,1):$next;
//判斷title有沒有在設定陣列內
$row_title_other = (substr($filename[$i],0,1) == "#") ? substr($filename[$i],1):$filename[$i];
if(in_array($row_title_other,$file_name1)){
//先判斷下一筆是否為title
if(in_array($next_title,$file_name1)){
//此為下值為空白 再判斷是否要設為隱藏
if(in_array($row_title_other,$hidden)){
echo "".$row_title_other." | ";
}else{
echo "
".$row_title_other." | ";
}
//判斷是否可以重複新增
if(in_array($row_title_other,$name_rp)){
echo "";
$str_replace = str_replace(' ','_',$row_title_other);
echo "";
}
echo " |
";
}else{
//判斷倒數第二筆資料是否有值
if(in_array($row_title_other,$file_name1) && ($next == "")){
echo "".$row_title_other." | |
";
}else{
if(in_array($row_title_other,$hidden)){
echo " | ";
$title = $row_title_other;
$j = 1;
}else{
echo "
".$row_title_other." | ";
$title = $row_title_other;
$j = 1;
}
}
}
}elseif($j == 1){
//判斷是否可以重複新增
if(in_array($title,$name_rp)){
if(in_array($title,$hidden)){
echo "";
}else{
echo " | ";
$str_replace = str_replace(' ','_',$title);
echo "";
}else{
echo " | ";
}
}
echo " |
";
$j++;
}elseif($j > 1){
echo "".$title." | ";
echo " |
";
$j++;
}else{
if($filename[$i] != "BLOCK CONFIG BY ONE ITEM"){
echo "".$filename[$i]." | |
";
}
}
}
?>