区分文本中的文字与图片 图片描述的部分 是指各个title吗?那就有多个哦。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $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'; $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]); //图片描述 Uploadify3.1上传5M以上文件显示成功,实际没上传成功 虚心请教,Fckeditor2.6.6在PHP中应用遇到一些问题 求一正则表达式 Zend Studio的一点小问题 php生成xml中中文乱码 全站用utf8好,还是gb2312呢? 正则匹配 回车换行。 招聘PHP工程师 php怎么传值给客户端????急!!!!!!!!1 初学PHP,怎么在PHP中添加系统用户? PHP 会自动把数据中的“+”解码为空格 一个会员点击一个课程后,该课程状态变为再学一遍
$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';
$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]); //图片描述