"함수 extract urls()"의 두 판 사이의 차이

(새 문서: 분류: URL ==PHP== 분류: PHP <source lang='php'> function extract_urls($text) { preg_match_all("/(\b(?:(?:https?|ftp):))?\/\/[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_...)
 
9번째 줄: 9번째 줄:
}
}
</source>
</source>
==같이 보기==
*[[함수 preg_match_all()]]

2016년 4월 23일 (토) 00:48 판


1 PHP

function extract_urls($text) {
	preg_match_all("/(\b(?:(?:https?|ftp):))?\/\/[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i", $text, $matches);
	return $matches[0];
}

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}