如何实现内容与图片分离!!! 用正则去除图片信息,然后就显示文本行了 解决方案 » 这又该如何实现呢!!如何用正则去除图片信息??? 请看正则表达式的学习内容…… 你为什么在做数据库时不将二者分开呢??? 我用正则表达式把图片和文字分开了!!!就是用这个正则表达式:<? $MYSQL->query("select * from enterprise_dynamic order by id desc limit 0,1"); $content=StripSlashes($MYSQL->data[content]); $eg="/<[i|I]{1}[m|M]{1}[g|G]{1} [^>]*[s|S]{1}[r|R]{1}[c|C]{1}\s*=\s*[^<>\s]*\s*[^<>\s]*\s*>/"; preg_match_all($eg,$content,$news_img); $eg1="/\s*[^=\"<>]*[.]{1}[^\s\"<>]*/"; preg_match_all($eg1,$news_img[0][0],$news_img1); $content=preg_replace($eg,"",$content); $eg="/<[^<>]*>/"; $content=preg_replace($eg,"",$content); $content=strip_tags($content); ?>请各位参考!! 正则批量替换 php 由表单传过来的值 在数据库里搜索不到 无法使用curl_init函数 桌面软件和网站数据对接,用什么开发比较好? asterisk (php方面的开发) 在线求救!!~~~关于 页面转换!!高手请指教 请指点迷途! 为什么我用的fckeditor不能上传图片? 请教,php如何读取动态网页得内容 我一直想不明白的一个问题,php save files from url,页面个别元素就是获取不到!? 如何读取附件的内容!! 问个简单又复杂的问题
就是用这个正则表达式:<?
$MYSQL->query("select * from enterprise_dynamic order by id desc limit 0,1");
$content=StripSlashes($MYSQL->data[content]);
$eg="/<[i|I]{1}[m|M]{1}[g|G]{1} [^>]*[s|S]{1}[r|R]{1}[c|C]{1}\s*=\s*[^<>\s]*\s*[^<>\s]*\s*>/";
preg_match_all($eg,$content,$news_img);
$eg1="/\s*[^=\"<>]*[.]{1}[^\s\"<>]*/";
preg_match_all($eg1,$news_img[0][0],$news_img1);
$content=preg_replace($eg,"",$content);
$eg="/<[^<>]*>/";
$content=preg_replace($eg,"",$content);
$content=strip_tags($content);
?>
请各位参考!!