// ACF TABLE TO ARRAY(PHP8安全版) function acf_table_to_array($table){ // ACFのtable fieldがfalse/null/オブジェクトでも落ちないようにする if (!$table) { return []; } // 配列化 $table = (array)$table; // header/body が無いケースを吸収 $headerRows = (isset($table['header']) && is_array($table['header'])) ? $table['header'] : []; $bodyRows = (isset($table['body']) && is_array($table['body'])) ? $table['body'] : []; $data = []; // ヘッダー if (!empty($headerRows)) { $header = []; foreach ($headerRows as $th) { if (is_array($th) && isset($th['c'])) { $header[$th['c']] = $th['c']; } } if (!empty($header)) { $data[] = $header; } } // ボディ if (!empty($bodyRows)) { foreach ($bodyRows as $tr) { if (!is_array($tr)) continue; $row = []; $i = 0; foreach ($tr as $td) { $key = $i; // headerがあるならヘッダ名をキーにする(無ければ連番) if (!empty($headerRows) && isset($headerRows[$i]['c'])) { $key = $headerRows[$i]['c']; } $row[$key] = (is_array($td) && array_key_exists('c', $td)) ? $td['c'] : ''; $i++; } $data[] = $row; } } return $data; } } ?> Site is undergoing maintenance

買取屋アップ

HPメンテナンスしております。店舗は通常営業です。

Site will be available soon. Thank you for your patience!

パスワード紛失