-
url 타입의 문자열이 있을때 자동으로 링크 거는 함수다. jQuery.fn.autolink = function () { return this.each( function(){ var re = /((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g; $(this).html( $(this).html().replace(re, '$1 ') ); }); }
원하는 자리수의 난수를 발생 시키는 php 함수function rand_code($cleng, $cc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') { $len = strlen($cc) - 1; $result = ''; while($cleng-->0) $result .= $cc{mt_rand(0, $len)}; return $result;}