这是我的代码:
<?php
$url = 'http://www.ebay.de/itm/321773181887';
$aufrufe_content = file_get_contents($url);
$aufrufe1 = explode( '<span id="vi-time-wrapperSection">' , $aufrufe_content );
$aufrufe2 = explode("</span></span>" , $aufrufe1[1] );
echo $aufrufe2[0];
?>
我如何删除“Restzeit:”这个词?
我在其他网站上看到我可以用“str_replace”解决我的问题,但我不知道如何在我的代码中使用它。
答案 0 :(得分:0)
就这么简单:
<?php
// ... the first 4 lines
$aufrufe2 = explode("</span></span>" , $aufrufe1[1]);
$temp = str_replace('Restzeit: ','',$aufrufe2[0]);
echo $temp;
?>