example.html(包含数百个文件的巨大表,因此不可能将所有文件都列为数组):-
<table>
<tbody>
<tr>
<td class="book"><a class="booklink" href="../file1.pdf" >Book1</a></td>
<td class="year">2007</td>
<td class="pages">32p</td>
</tr>
<tr>
<td class="book"><a class="booklink" href="../file2.pdf" >Book2</a></td>
<td class="year">2010</td>
<td class="pages">12p</td>
</tr>
<tr>
<td class="book"><a class="booklink" href="../file3.pdf" >Book3</a></td>
<td class="year">2013</td>
<td class="pages">42p</td>
</tr>
<!--------and so on... -------->
如何使用 PHP DOM 跟踪 file1.pdf、file2.pdf、file3.pdf(等等)的文件大小,以使用类名“filesize”自动显示 __ KB(或.__MB 如果更大)?
<table>
<tbody>
<tr>
<td class="book"><a class="booklink" href="../file1.pdf" >Book1</a></td>
<td class="year">2007</td>
<td class="pages">32p</td>
<td class="filesize">___KB(or_.__MB if larger)</td>
</tr>
<tr>
<td class="book"><a class="booklink" href="../file2.pdf" >Book2</a></td>
<td class="year">2010</td>
<td class="pages">12p</td>
<td class="filesize">___KB(or_.__MB if larger)</td>
</tr>
<tr>
<td class="book"><a class="booklink" href="../file3.pdf" >Book3</a></td>
<td class="year">2013</td>
<td class="pages">42p</td>
<td class="filesize">___KB(or_.__MB if larger)</td>
</tr>
<!--------and so on... -------->