PHP正则表达式问题

txh027 2014-08-10 07:12:16
不知道怎么传不进去图片,图片链接:http://v1.freep.cn/3tb_140810190849ipix512293.jpg

我希望提取姓  名: 性  别: 等等后的信息,这个该怎么写,表达的不是很好相信大家都能理解
   <tr><td height="1" colspan="3" bgcolor="#800080"></td></tr>
</table>
<table border="0" cellpadding="0" width="474">
<tr>
<td height="30" colspan="3" width="468">您当前的报考信息如下:
<i> (报名时间:<font color="#000080"></font>
更新时间:<font color="#000080">2014-2-28 13:57:13)</font></i>
</td>
</tr>
<tr>
<td width="165" height="202" align="center" rowspan="7"><img border="0" src="photos/2012614053.jpg" width="144" height="192" alt="这里应该显示您的登记照片。如果你之前已经上传却始终无法看到该照片,则说明上传照片格式不符合要求,已经被管理员删除,你需要重新上传或统一照相,统一照相日程安排请密切注意网站通知"></td>
<td height="30" colspan="2" width="299">学  号:2012614053</td>
</tr>
<tr>
<td height="30" width="141">姓  名:个人</td>
<td height="30" width="154">性  别:男</td>
</tr>
<tr>
<td height="30" width="141">报考语种:英语</td>
<td height="30" width="154">报考等级:4</td>
</tr>
<tr>
<td height="30" colspan="2" width="299">身份证号:421083199402038812</td>
</tr>
<tr>
<td height="30" colspan="2" width="299">所在学院:计算机科学与技术学院</td>
</tr>
<tr>
<td height="30" colspan="2" width="299">所学专业:软件开发</td>
</tr>
<tr>
<td height="30" width="141">所在年级:2012</td>
<td height="30" width="154">学制:4  学历:2</td>
</tr>
<tr>
<td align="center" width="165">↑登记照片↑</td>
<td height="30" width="141">照片:[2]</td>
<td height="30" width="154">报名费用:已缴纳</td>
</tr>
<tr>
<td align="left" width="165">审核标记:1</td>
<td height="30" width="295" colspan="2">审核意见:<font color=#ff0000>暂未审核,请随时留意!</font>
</td>
</tr>
<tr>
<td height="30" colspan="3" width="468"><font color="#FF00FF">注意如果你刚上传过照片,可能要刷新(F5)该页面才能正确显示最新的照片。</font></td>
</tr>
<tr>
<td height="1" colspan="3" bgcolor="#800080" width="468"></td>
</tr>
<tr>
<td height="30" align="center" colspan="3" width="468"><a href="./">返回首页</a>
<a href="accuse.asp">查看其他同学报名信息</a></td>
</tr>

</table>
</td>
</tr>
</table>
...全文
115 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jingzhangongsi 2014-08-11
  • 打赏
  • 举报
回复
jingzhangongsi 2014-08-11
  • 打赏
  • 举报
回复
jingzhangongsi 2014-08-11
  • 打赏
  • 举报
回复
xuzuning 2014-08-10
  • 打赏
  • 举报
回复
$s =<<< TXT
   <tr><td height="1" colspan="3" bgcolor="#800080"></td></tr>
                    </table>
                    <table border="0" cellpadding="0" width="474">
                    <tr>
                      <td height="30" colspan="3" width="468">您当前的报考信息如下:
                        <i> (报名时间:<font color="#000080"></font>
                        更新时间:<font color="#000080">2014-2-28 13:57:13)</font></i>
                      </td>
                    </tr>
                    <tr>
                      <td width="165" height="202" align="center" rowspan="7"><img border="0" src="photos/2012614053.jpg" width="144" height="192" alt="这里应该显示您的登记照片。如果你之前已经上传却始终无法看到该照片,则说明上传照片格式不符合要求,已经被管理员删除,你需要重新上传或统一照相,统一照相日程安排请密切注意网站通知"></td>
                      <td height="30" colspan="2" width="299">学  号:2012614053</td>
                    </tr>
                    <tr>
                      <td height="30" width="141">姓  名:个人</td>
                      <td height="30" width="154">性  别:男</td>
                    </tr>
                    <tr>
                      <td height="30" width="141">报考语种:英语</td>
                      <td height="30" width="154">报考等级:4</td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2" width="299">身份证号:421083199402038812</td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2" width="299">所在学院:计算机科学与技术学院</td>
                    </tr>
                    <tr>
                      <td height="30" colspan="2" width="299">所学专业:软件开发</td>
                    </tr>
                    <tr>
                      <td height="30" width="141">所在年级:2012</td>
                      <td height="30" width="154">学制:4  学历:2</td>
                    </tr>
                    <tr>
                      <td align="center" width="165">↑登记照片↑</td>
                      <td height="30" width="141">照片:[2]</td>
                      <td height="30" width="154">报名费用:已缴纳</td>
                    </tr>
                    <tr>
                      <td align="left" width="165">审核标记:1</td>
                      <td height="30" width="295" colspan="2">审核意见:<font color=#ff0000>暂未审核,请随时留意!</font>
                      </td>
                    </tr>
                    <tr>
                      <td height="30" colspan="3" width="468"><font color="#FF00FF">注意如果你刚上传过照片,可能要刷新(F5)该页面才能正确显示最新的照片。</font></td>
                    </tr>
<tr>
  <td height="1" colspan="3" bgcolor="#800080" width="468"></td>
</tr>
<tr>
                      <td height="30" align="center" colspan="3" width="468"><a href="./">返回首页</a>
                        <a href="accuse.asp">查看其他同学报名信息</a></td>
</tr>
 
                  </table>
                </td>
              </tr>
            </table>
TXT;
preg_match_all('/>(.+):(.+)</', $s, $m);
print_r($m);
    [1] => Array
        (
            [0] => 学  号
            [1] => 姓  名
            [2] => 性  别
            [3] => 报考语种
            [4] => 报考等级
            [5] => 身份证号
            [6] => 所在学院
            [7] => 所学专业
            [8] => 所在年级
            [9] => 学制:4  学历
            [10] => 照片
            [11] => 报名费用
            [12] => 审核标记
            [13] => 审核意见
        )

    [2] => Array
        (
            [0] => 2012614053
            [1] => 个人
            [2] => 男
            [3] => 英语
            [4] => 4
            [5] => 421083199402038812
            [6] => 计算机科学与技术学院
            [7] => 软件开发
            [8] => 2012
            [9] => 2
            [10] => [2]
            [11] => 已缴纳
            [12] => 1
            [13] => <font color=#ff0000>暂未审核,请随时留意!
        )

txh027 2014-08-10
  • 打赏
  • 举报
回复


图片在2楼

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧