php - Extract heading and paragraphs of a docx-file -
i need read docx-file i.e. headings , content of document in variables. i'm reading file this: function read_file_docx($filename){ if(!$filename || !file_exists($filename)) return false; $zip = zip_open($filename); if (!$zip || is_numeric($zip)) return false; while ($zip_entry = zip_read($zip)) { if (zip_entry_open($zip, $zip_entry) == false) continue; if (zip_entry_name($zip_entry) != "word/document.xml") continue; $content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); zip_entry_close($zip_entry); } zip_close($zip); //$striped_content = strip_tags($content); return $striped_content; } my problem how i.e. heading1, heading2 , heading 3 , content of parts in array further processing.