script to output results

Dear Experts,

Please have a look at the php script below, it runs a command using exec and captures the value returned by the command.  How do I put this command into a bash script file, then get php to run that script file?
        # file to be converted
        $dirty_string = "file.pdf";
        $clean_string = escapeshellarg($dirty_string);
        # command to convert the file
        $command = "pdftotext -raw -enc UTF-8 ".$clean_string." -";
        # executing the command
        exec($command, $retval);
        # saving converted array to string
        $mystring = implode("",$retval);
        # use string to save to database
        echo $mystring;

Open in new window

Who is Participating?
NeoAshuraConnect With a Mentor Commented:
first;y download this tool and run it. its for bash u may already have it..

then secondly save your file as a text file .txt and run it using php.. as follows..

$result=shell_exec("C:\bash-2.03\bash.exe test.txt");
glad i could be of service thanks for awarding the points so quickly.
All Courses

From novice to tech pro — start learning today.