2013-08-16 31 views
-2

朋友們,我想打印一個名爲text的文本區域中的內容。我知道window.print()函數,但使用它只允許我打印整個網頁。我需要什麼,雖然是隻打印特定textarea的內容...在PHP中打印到textarea時剝去不需要的標籤

我的代碼如下:

<?php 
$sq="SELECT * FROM $db->db_schema.visit_reg where patient_id=$user_id and complaint_id=$complaint_id"; 
$result=$db->query($sq); 
echo "<textarea name='text' rows='4' cols='47' >"; 
echo $result[0]['prescription']; 
echo "</textarea>"; 
?> 

要重申,我想打印textarea的內容只有,而不是整個網頁。

回答