URL 자동 링크 함수 > 소스코드

본문 바로가기
사이트 내 전체검색


회원로그인

소스코드

php | URL 자동 링크 함수

페이지 정보

작성자 100K5 작성일15-06-25 14:34 조회73,666회 댓글0건

본문

function autolink($str){
// URL
$str=eregi_replace("(http|https|ftp|telnet|news)://([-/.a-zA-Z0-9_~#%$?&=:\200-\377\(\)]+)"," \\1://\\2",$str);
$str=str_replace("=","=",$str);
$str=str_replace("=\" ","=\"",$str);
$str=str_replace("='","='",$str);
$str=eregi_replace(" (http|https|ftp|telnet|news)://([-/.a-zA-Z0-9_~#%$?&=:\200-\377\(\)]+)","\\1://\\2",$str);

// MAIL
$str=eregi_replace("([\xA1-\xFEa-z0-9_-]+@[\xA1-\xFEa-z0-9-]+\.[a-z0-9-]+)"," \\1",$str);
$str=str_replace("mailto:","mailto:",$str);
$str=eregi_replace(" ([\xA1-\xFEa-z0-9_-]+@[\xA1-\xFEa-z0-9-]+\.[a-z0-9-]+)","\\1",$str);

return $str;
}

$comment=autolink($comment);


원본 : https://www.technote.co.kr/php/technote1/board.php/board.php?board=apple&page=11&command=body&no=1250&no=1249

댓글목록

등록된 댓글이 없습니다.


사이트소개 개인정보취급방침 서비스이용약관 Copyright © kkujunhee.net All rights reserved.
상단으로

개인정보관리책임자 : 관리자

모바일 버전으로 보기