Home > php教程 > php手册 > 用于网页内容所有 联接的函数 标题 这样的内容

用于网页内容所有 联接的函数 标题 这样的内容

WBOY
Release: 2016-06-21 09:06:35
Original
944 people have browsed it

函数|网页

/*
    用于所有联接的函数 标题 这样的内容
 */
function get_title($tmp)
{
    $title_array    = array();
    $pattern="@(.*?)]*?)href=(['"s]?)([^>'"s]+)(['"s]?)([^>]*?)>(.+?)(.*)@is";
    $tmp_i    =0;
    while(preg_match($pattern,$tmp,$reg))
    {
        $title_array[$tmp_i]["url"]        = $reg[4];
        $title_array[$tmp_i]["title"]    = $reg[7];
        $tmp=$reg[1].$reg[8];
        $tmp_i++;
    }
    return $title_array;
}

 



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template