Thank you very much for your help so far :o)
ok i have completed the other test too.
It looks like that the
printer_write($handle, "Text \n\rTo print");
did write 2 seporate lines. without using the \r switch the output was:
Text
To print
if i included the \r the output was:
Text
To Print
My next step would have the php code to send the text file to an array splitting the text file for each line and sending it to a loop to print to the printer. which im not really sure how to do?
Having studyed lots of code I have found the following code will output text file to an array
<?php
$file_handle = fopen("receipt.txt", "rb");
while (!feof($file_handle) ) {
$line_of_text = fgets($file_handle);
$parts = explode(':', $line_of_text);
print $parts[0] . $parts[1]. "<BR>";
}
fclose($file_handle);
?>
Which outputs sucessfully to the screen. But it looks like that when it gets to the end of the file having no more text to print it displays the following errors
PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25 PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25 PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25 PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25 PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25 PHP Notice: Undefined offset: 1 in C:\Inetpub\wwwroot\takeaway\receipt.php on line 25