区分文本中的文字与图片 图片描述的部分 是指各个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]); //图片描述 正则表达式求解 PHP rewirte 问题 PHP怪现象,就phpMyAdmin的index.php文件,PHP后缀小写不解析,大写才解析 我最近做了一个网站,请高手指点一下网址供上! 这两天新做了一个PHP网站,望大家给点意见 还是问一个mysql的查询汇总的汇总问题 大家来看看我写的[下载功能]程序 个人网站,请提意见!PHP+MYSQL 200分求大神, zend studio调试的问题,求大神相助啊,搞了两天了!! 大四去面试,一个好的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]); //图片描述