PHP 7.1.1 - All printer functions not working : <p>I am trying to print using PHP I am using php version 7.1.1 xamp in my local machine. I have seen many answers or solution but they did not work. Some solutions included downloading and installing php_printer.dll, but i still fail.
i tried printer_list(), printer_open(); nun of this work. i get Fatal error: Uncaught Error: Call to undefined function printer_list() and so on.</p>

<pre><code> ///////////////////////////example 1//////////////
//////////////////////////////////////////////////
$print_data = $_POST['zpl_data']; 
try
{
    $fp=pfsockopen("10.136.3.64",0001); //9100
    fputs($fp,'test');
    fclose($fp);

    echo 'Successfully Printed';
}
catch (Exception $e) 
{
    echo 'Caught exception: ',  $e-&gt;getMessage(), "\n";
}

 /////////////////example 2////////////////////////////
/////////////////////////////////////////////////////////
$handle = printer_open('\\\\192.168.2.206:9100\\'); 
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_write($handle, "TEXT To print"); 
printer_close($handle);
$printer_name = "Your Printer Name exactly as it is"; 
$handle = printer_open($printer_name);
printer_start_doc($handle, "My Document");
printer_start_page($handle);
$font = printer_create_font("Arial", 100, 100, 400, false, false, false, 0);
printer_select_font($handle, $font);
printer_draw_text($handle, 'This sentence should be printed.', 100, 400);
printer_delete_font($font);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);

///////////example 3 ///////////////////////////
///////////////////////////////////////////////
 var_dump(printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED));
</code></pre>
