我正试图利用PHP IMAP图书馆的“密码>imap()”功能从谷歌中抽出一个邮件,我想使用<代码>前_match(打电话给我的邮件内容,但我有一个奇怪的问题,即我有曲解的断线,改变了正常的<代码>preg_match()。
More details: I have in my markup something like that:
<TABLE CELLPADDING=5 RULES=GROUPS FRAME=BOX>
<THEAD>
<TR> <TH>Résumé points de classement</TH> <TH>Extérieur</TH> <TH>Domicile</TH> </TR>
</THEAD>
<TBODY>
<TR> <TD>Équipe</TD> <TD>Milan</TD> <TD>Arsenal</TD> </TR>
<TR> <TD>Performance du match</TD> <TD>0</TD> <TD>19</TD> </TR>
<TR> <TD>Étoiles équipe</TD> <TD>0</TD> <TD>0</TD> </TR>
<TR> <TD>Points totaux</TD> <TD>3195</TD> <TD>3273</TD> </TR>
<TR> <TD>Niveau actuel</TD> <TD>22</TD> <TD>22</TD> </TR>
<TR> <TD>Points pour le prochain niveau</TD> <TD>5</TD> <TD>127</TD> </TR>
</TBODY>
</TABLE>
我正在执行这一法典,以摘录如下机构:
<?php
// $message is the previous markup.
$str = substr($message, 321, 10);
var_dump($str);
$str = preg_replace("/ /i","",$str);
var_dump($str);
?>
该法典的产出是:
<pre class= xdebug-var-dump dir= ltr ><small>string</small> <font color= #cc0000 >
&lt;TABLE </font> <i>(length=13)</i>
</pre>
<pre class= xdebug-var-dump dir= ltr ><small>string</small> <font color= #cc0000 >
&lt;TABLE </font> <i>(length=13)</i>
</pre>
And the extracted value is an empty array... After further investigation i discovered through a var_dump()
of my source string that there is a
at the end of each line.
I have no clue of what this html char code is and how to remove it.