PHP replace picture alt with Title Tag _php Tutorial

Source: Internet
Author: User
To replace all the images or the alt title of the connection, we must use the regular function, see a replacement picture Alt instance

*/

preg_replace (' #alt = ' [^ ']* ' #i ', ' alt= ' ". $title." ", $str);

/*
Mixed preg_replace (mixed pattern, mixed replacement, mixed subject [, int limit])


Searches the subject for a match in pattern mode and replaces it with replacement. If limit is specified, only the limit match is replaced, and if the limit is omitted or the value is-1, all occurrences are replaced.


Filter all HTML tags
*/

$html _body = "
FDAFDSA content ";
Preg_replace ("/( ]*>)/E",
"' 1 '. Strtoupper (' 2 '). ' 3 ' ",
$html _body);



For more details please see: PHP tutorial Er/php-function/33530.htm ">http://www.bkjia.c0m/phper/php-function/33530.htm

http://www.bkjia.com/PHPjc/632986.html www.bkjia.com true http://www.bkjia.com/PHPjc/632986.html techarticle to replace all of the images or the connected ALT title we must use the regular function, see a replacement picture alt instance */preg_replace (' #alt =[^]* #i ', ' alt=. $title. ', $STR); */* M ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.