<?php
function convert(){
//enable error reporting for debugging
error_reporting(E_ALL | E_STRICT);
//convert pdf's to html using payroll.sh script and
//pdftohtml command line tool
$program = "payroll.sh";
$toexec="sh /var/www/html/tmp/" . $program . " 2>&1";
$exec=shell_exec($toexec);
//display message from payroll.sh
//echo $exec;
//echo ('<br/>');
}
function process(){
$dir = '/var/www/html/tmp/converted';
//echo ('one');
if (is_dir($dir)) {
//echo ('two');
if ($dh = opendir($dir)) {
//echo ('three');
while (($file = readdir($dh)) !== false) {
//echo ('four');
if ($file != "." && $file != ".."){
echo …Run Code Online (Sandbox Code Playgroud) php ×1