您好我想幫助的情況下,我有一個文件夾叫「滑梯」,我有它的多個text/html的文件,如: slide1.html slide2.html slide3.html 等等.....解析多個HTML /文本文件
這些文件的結構是這樣的:
<h2>Title of the Slide</h2>
<p><a href="http://mydomain.com"><img src="tick_icon.jpg" width="227" height="227" alt="icon" longdesc="http://longdescription" /></a></p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
3屬性標題,圖片和說明。每行一個。
我有一些這樣的10 - 12個文件。我想要一個函數,它將循環並解析名爲'slides'
的文件夾中的所有這些文件,並將每行(3行)的值作爲變量返回,以便我可以將它們放在我的代碼中進行佈局。
你的問題是:
你可以在PHP中使用類似做到這一點? – 2011-01-11 18:33:04
您是否可以更精確地瞭解您希望如何處理HTML?特別是,我不確定你的意思是「每條線的價值」。另外,你有一個首選的語言來寫這個嗎? – Karmastan 2011-01-11 18:33:49