title: how to get first page content of docx in php
body: <p>i want to get docx file fist page text only, suppose business.docx file has 5 pages, now i want to show only first page content and hide rest of the 4 pages text.
  following is the code that read docx file.</p>
  
  <pre><code>function read_file_docx($filename)
  {
      $striped_content = '';
      $content = '';
  
      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);
      }// end while
  
      zip_close($zip);
  
      //echo $content;
      //echo "&lt;hr&gt;";
      //file_put_contents('1.xml', $content);     
  
      $content = str_replace('&lt;/w:r&gt;&lt;/w:p&gt;&lt;/w:tc&gt;&lt;w:tc&gt;', " ", $content);
      $content = str_replace('&lt;/w:r&gt;&lt;/w:p&gt;', "\r\n", $content);
      $striped_content = strip_tags($content);
  
      return $striped_content;
  }
  </code></pre>
  
  <p>i also want ms word text formatting like bold, italic, bullet, etc... i have google but cant get code which give me option to show docx first page content. </p>