나는 클릭 가능한 링크 URL을 만들기 위해이 기능을 사용하지만, 문제는 단지 그 문자 이전에 클릭 가능한 링크가되는 URL의 일부 유니 코드 문자가 ...있을 때유니 코드 문자가 포함 된 URL을 클릭 가능한 링크로 변환하는 방법은 무엇입니까?
기능 :
function clickable($text) {
$text = eregi_replace('(((f|ht){1}tp://)[[email protected]:%_\+.~#?&//=]+)',
'<a class="und" href="\\1">\\1</a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[[email protected]:%_\+.~#?&//=]+)',
'\\1<a href="http://\\2">\\2</a>', $text);
$text = eregi_replace('([_\.0-9a-z-][email protected]([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',
'<a href="mailto:\\1">\\1</a>', $text);
return $text;
}
이 문제를 해결하는 방법?
문자 클래스와 하드 코딩'A-ZA-Z'를 교체하십시오,': 자리 : ', ': alpha :'와': lower :'와': upper :'등등? – sarnold
* (sidenote) * [POSIX Regex functions] (http://www.php.net/manual/en/ref.regex.php)는 PHP 5.3.0부터 사용되지 않습니다. 대신 [PCRE family] (http://www.php.net/manual/en/book.pcre.php)를 사용해보십시오. – Gordon