我有这个表作为变量我想使用strip_tags函数:
<?php $tbl='
<table id="patients">
<tr>
<th>Pt. username</th>
<th>Pt. number</th>
<th>Full Name</th>
<th>Added on</th>
</tr> <tr><td><a href="profile.php?username=fringo123"</a>fringo123</td>
<td>3</td>
<td>fringo123 shreiwekh</td>
<td>2014-02-12 22:16:53</td>
</tr> <tr class="alt"><td><a href="profile.php?username=kamal"</a>kamal</td>
<td>24</td>
<td>kamal kab</td>
<td>2014-03-06 03:01:24</td>
</tr> <tr><td><a href="profile.php?username=kissaye"</a>kissaye</td>
<td>20</td>
<td>shreiwekh</td>
<td>2014-03-03 14:34:59</td>
</tr> <tr class="alt"><td><a href="profile.php?username=maas12345"</a>maas12345</td>
<td>7</td>
<td>maas12345</td>
<td>2014-02-13 20:23:56</td>
</tr> <tr><td><a href="profile.php?username=maas123456"</a>maas123456</td>
<td>8</td>
<td>maas123456</td>
<td>2014-02-13 20:25:51</td>
</tr> <tr class="alt"><td><a href="profile.php?username=marly"</a>marly</td>
<td>9</td>
<td>Marly Mario</td>
<td>2014-02-19 22:02:50</td>
</tr> <tr><td><a href="profile.php?username=mohamad"</a>mohamad</td>
<td>10</td>
<td>mohamad salem</td>
<td>2014-02-19 22:27:48</td>
</tr> <tr class="alt"><td><a href="profile.php?username=rami1234"</a>rami1234</td>
<td>6</td>
<td>rami1234</td>
<td>2014-02-13 20:21:48</td>
</tr> <tr><td><a href="profile.php?username=ramizmo"</a>ramizmo</td>
<td>25</td>
<td>ramy om</td>
<td>2014-03-06 03:26:52</td>
</tr> <tr class="alt"><td><a href="profile.php?username=saeed"</a>saeed</td>
<td>16</td>
<td>Saeed Shaweesh</td>
<td>2014-02-28 21:59:37</td>
</tr> <tr><td><a href="profile.php?username=sheeerokh"</a>sheeerokh</td>
<td>21</td>
<td>sheeerokh mo7sen</td>
<td>2014-03-03 14:43:45</td>
</tr> <tr class="alt"><td><a href="profile.php?username=sheeerokh22"</a>sheeerokh22</td>
<td>22</td>
<td>sheeerokh mo7sen22</td>
<td>2014-03-03 14:45:50</td>
</tr> <tr><td><a href="profile.php?username=shinyor"</a>shinyor</td>
<td>23</td>
<td>shinyor kalb</td>
<td>2014-03-03 14:47:40</td>
</tr></table>';
当我运行strip_tags时,我只得到四个表头部分而不是表格的其余部分。我做错了什么?这就是我得到的:
的Pt。 usernamePt。在
上添加了numberFull Name答案 0 :(得分:0)
您只需关闭支架即可。
<a href="profile.php?username=fringo123"</a>fringo123
到
<a href="profile.php?username=fringo123">fringo123</a>
等