Readfile并仅打印特定内容

时间:2014-03-31 13:09:19

标签: php html

$fh = fopen('http:xxxxxxx.com/rates.php','r') or die($php_errormsg);
echo $fh ;

结果

<div class="Cf_row_v_lft splcolor2 Itemcont"> <div class="Itemdiv"><b>88</b></div> <div> 17.4</div> </div> <div class="Cf_row_v_RHT splcolor2"> <div> <a class="splcolor2" target="_blank" href="/item/0/1/milk"><img style="display:none;visibility:hidden;" data-cfsrc='/item/article/t_49.png' width="22" align='absmiddle' data-cfstyle='margin:0;border:0;'/><noscript><img src='/item/article/t_50.png' width="22" align='absmiddle' style='margin:0;border:0;'/></noscript></a></div> <div><b>NED</b></div> </div> </div> <div class="Cf_row_v_RHT splcolor2 itemcont"> <div class="Itemdiv"><b>133</b></div> <div>20.58</div>  </div>  </div><div class="showhidecontentdadt-3 showhidecontentdadta">This price update at Mar 3 2014</div>

我只想打印class =&#34; Itemdiv&#34; ,<div>20.58</div><div class="showhidecontentdadt-3 showhidecontentdadta">This price update at Mar 3 2014</div>

1 个答案:

答案 0 :(得分:0)

CSS帮助你!您必须在@media print {//here}中定义打印样式。 访问:http://coding.smashingmagazine.com/2011/11/24/how-to-set-up-a-print-style-sheet/