Example #1
1
        echo nl2br("\n");
    }
}
$dir = "files";
$files1 = scandir($dir);
$file = scandir("classrooms");
/*remaining array*/
$big = array();
//classroom reading work
$content3 = read_file_docx($file[2], 1);
$content3 = explode(' ', $content3);
$content = "";
$big = array();
//reading the contents into an array. Now my array contains content from each file as string
for ($i = 2; $i < count($files1); $i++) {
    $temp = read_file_docx($files1[$i], 0);
    $temp = explode(' ', $temp);
    $temp = array_slice($temp, 0);
    $big = array_merge($big, $temp);
}
$class_no = count($content3);
$together = array();
$i = 0;
$j = floor(count($big) / 2);
$half = floor(count($big) / 2);
while ($j <= count($big)) {
    if ($j == count($big)) {
        if ($i == $half) {
            break;
        } else {
            while ($i < $half) {
Example #2
0
 public function getContentWord($filename = null)
 {
     $content = read_file_docx($filename);
     if ($content !== false) {
         echo nl2br($content);
     } else {
         echo 'Couldn\'t get the file. Please check that file.';
     }
 }