图片描述的部分 是指各个title吗?那就有多个哦。

解决方案 »

  1.   

    $str1是文字描述
    $str2是图片描述
    $content=<<<TXT
    <p>物品尺寸/规格:高24厘米,,好东西值得收藏。</p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157082579.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="1.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157109272.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="2.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157112075.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="3.jpg"/></p><p><br/></p>
    TXT;$data = explode('</p><p>', $content);
    $str1 = $data[0].'</p>';
    unset($data[0]);
    $str2 = '<p>'.implode('</p><p>', $data);echo $str1;
    echo $str2';
      

  2.   


    $s='<p>物品尺寸/规格:高24厘米,,好东西值得收藏。</p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157082579.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="1.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157109272.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="2.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157112075.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="3.jpg"/></p><p><br/></p>';
    preg_match_all('/[\x7f-\xff]+/',$s,$a);
    $s1=implode('',$a[0]);
    preg_match_all('/title="(.*?)"/',$s,$b);
    echo $s1;    //文字部分
    print_r($b[1]);  //图片描述