PHP - 执行文件路径错误(Tesseract)

I have ran tesseract in the commandline and got results back ok but now i am using the same command with PHP exec it will not work.

The command is:

"C:\Program Files (x86)\Tesseract-OCR\tesseract.exe" "C:\xampp\htdocs\Atoms Projects\Tesseract\text.jpeg" "C:\xampp\htdocs\Atoms Projects\Tesseract\Out.txt"

I tried this code:

exec("C:\Program Files (x86)\Tesseract-OCR\tesseract.exe" "C:\xampp\htdocs\Atoms Projects\Tesseract\text.jpeg" "C:\xampp\htdocs\Atoms Projects\Tesseract\Out.txt");
print_r($msg);

How can i make the command work correctly?

Also is there any way to send in multiple lines? to split into vars like:

$exe = "C:\Program Files (x86)\Tesseract-OCR\tesseract.exe";
$img = "C:\xampp\htdocs\User Projects\Tesseract\text.jpeg";
$txt = "C:\xampp\htdocs\User Projects\Tesseract\Out.txt";

This is also not working:

$exe = "C:\Program Files (x86)\Tesseract-OCR\tesseract.exe";
$img = "C:\xampp\htdocs\Atoms Projects\Tesseract\text.jpeg";
$txt = "C:\xampp\htdocs\Atoms Projects\Tesseract\Out";
$output = exec("\"$exe\" \"$img\" \"$txt\" "); 
print_r($output);

I am using XAMPP on Windows OS.

I just found the solution which was to change all \ characters to / in the 3 paths like this:

$exe = "C:/Program Files (x86)/Tesseract-OCR/tesseract.exe";
$img = "C:/xampp/htdocs/Atoms Projects/Tesseract/text.jpeg";
$txt = "C:/xampp/htdocs/Atoms Projects/Tesseract/Out";
$output = exec("\"$exe\" \"$img\" \"$txt\" "); 
print_r($output);