Home » Php » PHP printer_open is printing html tags

PHP printer_open is printing html tags

Posted by: admin July 12, 2020 Leave a comment

Questions:

PHP printer_open is printing the html tags.
I use printer_set_option with raw and text but it prints the same thing.

below is my code:

            if($ph = printer_open()) 
            { 
               $content = $data; 
               printer_set_option($ph, PRINTER_MODE, "RAW"); 
               printer_write($ph, $content); 
               printer_close($ph); 
            } 
            else "Couldn't connect..."; 
How to&Answers:

With printer you can’t render html with printer but instead you can use echo!

Example:

<?php
echo file_get_contents( "filename.php" ); // get the contents, and echo it out.
?>