要做到替换所有图片或者是连接的alt title我们必须用到正则函数,下面看一个替换图片alt实例
*/
preg_replace('#alt="[^"]*"#i','alt="".$title.""',$str);
/*
mixed preg_replace ( mixed pattern, mixed replacement, mixed subject [, int limit])
在 subject 中搜索 pattern 模式的匹配项并替换为 replacement。如果指定了 limit,则仅替换 limit 个匹配,如果省略 limit 或者其值为 -1,则所有的匹配项都会被替换。
过滤所有html 标签
*/
$html_body ="
fdafdsa内容";
preg_replace("/(?)(w+)([^>]*>)/e",
"'1'.strtoupper('2').'3'",
$html_body);
//更多详细内容请查看:php教程er/php-function/33530.htm">http://www.bKjia.c0m/phper/php-function/33530.htm

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver Mac version
Visual web development tools
