【发布时间】:2011-02-01 23:15:42
【问题描述】:
我想在我的网页上显示来自另一个网页的新闻,但我想不出最好的方法。
另一个网页上的新闻显示在一个 div 类中,如下所示
<div class="news-container">
<div class="news-list"><a href="news/1/" title="abcd"><img src="abcd.jpg" /><strong>abcd</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/1/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/2/" title="efgh"><img src="efgh.jpg" /><strong>efgh</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/3/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/3/" title="ijkl"><img src="ijkl.jpg" /><strong>ijkl</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/3/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><a href="news/4/" title="mnop"><img src="mnop.jpg" /><strong>mnop</strong></a>
<p>What you see is what you get. <span class="morelink"><a href="news/4/" title="abcd">Read more</a></span></p>
<div class="clear-both"></div>
</div>
我希望能够循环浏览新闻并将它们显示在我自己的页面上,并根据我们自己的网站布局重新排列。
<div class="other-news">
<div class="news-list"><strong>abcd</strong>
<p>What you see is what you get. <a href="news/1/" title="abcd"><img src="abcd.jpg" /></a></p>
</div>
<div class="news-list"><strong>efgh</strong>
<p>What you see is what you get. <a href="news/3/" title="abcd"><img src="efgh.jpg" /></a> </p>
</div>
<div class="news-list"><strong>ijkl</strong>
<p>What you see is what you get. <a href="news/3/" title="abcd"><img src="ijkl.jpg" /></a> </p>
</div>
<div class="news-list"><strong>mnop</strong>
<p>What you see is what you get. <a href="news/4/" title="abcd"><img src="mnop.jpg" /></a> </p>
</div>
欢迎所有建议。
// 尼堡
【问题讨论】:
标签: php cross-domain