ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


php ¸¹À̾²´Â ÇÔ¼öÁ¤¸®
12³â Àü
function go($move = "back",$time = "0") {
    if($move == "back") echo("<script>history.back();</script>");
    else echo("<meta http-equiv='refresh' content='$time;url=$move'>");
}

//¸Þ½ÃÁöâ+È÷½ºÅ丮¹é
function alert($message,$move = "back") {
    $print = "<script>window.alert('$message');";
    if($move == "back") $print .= "history.back();";
    else $print .= "location.href = '$move';";
    $print .= "</script>";
    echo("$print");
    exit;
}

//µðºñÁ¢¼Ó
function db() {
    global $connect;
    if(!$connect) {
        $connect = mysql_connect("localhost","testid","1234") or die("MySQL Á¢¼Ó ½ÇÆÐ");
        mysql_select_db("testdb",$connect) or die("MySQL Á¢¼Ó ½ÇÆÐ");
    }
}

//´Ü¾î ÇÊÅ͸µ
function filter($string,$filter = "",$type = "change",$change = "###") {
    if(!$filter) return $string;
    $filter = explode(",",$filter);
    $fcount = sizeof($filter);
    for($i = 0;$i < $fcount;$i++) {
        if(eregi($filter[$i],$string)) {
            if($type == "error") alert(""$filter[$i]"Àº(´Â) ±ÝÄ¢¾îÀÔ´Ï´Ù.");
            else $string = str_replace($filter[$i],$change,$string);
        }
    }
    return $string;
}

//¹®ÀÚ¿­ Ä¿Æ®
function cutstr($str,$size) {
    if(!$size or (strlen($str) <= $size)) return $str;
    else for($i = 0;$i < $size;$i++) if(ord($str[$i]) > 127) $over++;
    return chop(substr($str,0,$size - $over%2))."...";
}

//Å×ÀÌºí »ý¼º¿©ºÎ üũ
function tablecheck($table,$db)
    $result = mysql_list_tables($db);
    for($i = 0;$i < mysql_num_rows($result);$i++) {
        if($table == mysql_tablename($result,$i)) return true;
    }
    return false;
}

//ºü¸¥ DBÀÚ·á ·Îµå(³ë°¡´Ù µµ¿ì¹Ì;;)
function select($table,$field = "*",$where = "") {
    if(!$table) return false;
    $q = "select $field from $table";
    if($where) $q .= " where $where";
    $result = mysql_query($q);
    $return = mysql_fetch_array($result);
    return $return;
}

//////////¾Æ·¡´Â Á¦·Îº¸µå lib.php¿¡¼­ ¹ßÃéÇÑ ÇÔ¼öÀÔ´Ï´Ù.

// ºó¹®ÀÚ¿­ °æ¿ì 1À» ¸®ÅÏ
function isblank($str) {
    $temp=str_replace("¡¡","",$str);
    $temp=str_replace("n","",$temp);
    $temp=strip_tags($temp);
    $temp=str_replace(" ","",$temp);
    $temp=str_replace(" ","",$temp);
    if(eregi("[^[:space:]]",$temp)) return 0;
    return 1;
}


// ¼ýÀÚÀÏ °æ¿ì 1À» ¸®ÅÏ
function isnum($str) {
    if(eregi("[^0-9]",$str)) return 0;
    return 1;
}


// ¼ýÀÚ, ¿µ¹®ÀÚ ÀÏ°æ¿ì 1À» ¸®ÅÏ
function isalNum($str) {
    if(eregi("[^0-9a-zA-Z_]",$str)) return 0;
    return 1;
}


// HTML Tag¸¦ Á¦°ÅÇÏ´Â ÇÔ¼ö
function del_html( $str ) {
    $str = str_replace( ">", ">",$str );
    $str = str_replace( "<", "<",$str );
    return $str;
}


// Áֹεî·Ï¹øÈ£ °Ë»ç
function check_jumin($jumin) {
    $weight = '234567892345'; // ÀÚ¸®¼ö weight ÁöÁ¤
    $len = strlen($jumin);
    $sum = 0;

    if ($len <> 13) return false;

    for ($i = 0; $i < 12; $i++) {
        $sum = $sum + (substr($jumin,$i,1)*substr($weight,$i,1));
    }

    $rst = $sum%11;
    $result = 11 - $rst;

    if ($result == 10) $result = 0;
    else if ($result == 11) $result = 1;

    $ju13 = substr($jumin,12,1);

    if ($result <> $ju13) return false;
    return true;
}


// E-mail ÁÖ¼Ò°¡ ¿Ã¹Ù¸¥Áö °Ë»ç
function ismail( $str ) {
    if( eregi("([a-z0-9_-.]+)@([a-z0-9_-.]+)", $str) ) return $str;
    else return '';
}

// E-mail ÀÇ MX¸¦ °Ë»öÇÏ¿© ½ÇÁ¦ Á¸ÀçÇÏ´Â ¸ÞÀÏÀÎÁö °Ë»ç
function mail_mx_check($email) {
    if(!ismail($email)) return false;
    list($user, $host) = explode("@", $email);
    if (checkdnsrr($host, "MX") or checkdnsrr($host, "A")) return true;
    else return false;
}


// ȨÆäÀÌÁö ÁÖ¼Ò°¡ ¿Ã¹Ù¸¥Áö °Ë»ç
function isHomepage( $str ) {
    if(eregi("^http://([a-z0-9_-./~@?=&-#{5,}]+)", $str)) return $str;
    else return '';
}


// URL, MailÀ» ÀÚµ¿À¸·Î üũÇÏ¿© ¸µÅ©¸¸µë
function autolink($str) {
    // URL ġȯ
    $homepage_pattern = "/([^"'=>])(mms|http|HTTP|ftp|FTP|telnet|TELNET)://(.[^ n<"']+)/";
    $str = preg_replace($homepage_pattern,"\1<a href=\2://\3 target=_blank>\2://\3</a>", " ".$str);

    // ¸ÞÀÏ Ä¡È¯
    $email_pattern = "/([ n]+)([a-z0-9_-.]+)@([a-z0-9_-.]+)/";
    $str = preg_replace($email_pattern,"\1<a href=mailto:\2@\3>\2@\3</a>", " ".$str);

    return $str;
}


// ÆÄÀÏ »çÀÌÁ kb, mb¿¡ ¸ÂÃ߾ º¯È¯Çؼ­ ¸®ÅÏ
function getfilesize($size) {
    if(!$size) return "0 Byte";
    if($size<1024) {
        return ($size." Byte");
    } elseif($size >1024 && $size< 1024 *1024)  {
        return sprintf("%0.1f KB",$size / 1024);
    }
    else return sprintf("%0.2f MB",$size / (1024*1024));
}

ÃßõÃßõ : 579 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,375
È÷¾î´Ú ¹®¹ý
2,374
Á¤±Ô½ÄÀÇ °³³ä
php ¸¹À̾²´Â ÇÔ¼öÁ¤¸®
2,372
À¯´ÏÄÚµå ÀÎÄÚµùÇϱâ
2,371
Å䷻Ʈ°Ë»ö±â
2,370
À¥ °èÁ¤¿¡¼­ Áö¿öÁöÁö ¾Ê´Â Æú´õ ¹× ÆÄÀÏ »èÁ¦ÇÏ´Â ¹æ¹ý
2,369
Çؽ÷κÎÅÍ Áֹεî·Ï¹øÈ£ º¹È£È­
2,368
°£´ÜÇÑ PHP ¹®¹ý
2,367
[PHP ±âÃÊ] º¯¼ö, »ó¼ö
2,366
À©µµÁî¿¡¼­ÀÇ Apahch ¼³Ä¡¹ý
2,365
±ÛÀÚ ±úÁü ¾øÀÌ ¹®ÀÚ¿­ ÀÚ¸£±â(hex2bin ÇÔ¼ö ÀÌ¿ë)
2,364
°èÁ¤(HDD) »ç¿ë·® Ãâ·ÂÇϱâ
2,363
Mysql DB»ç¿ë·® Ãâ·ÂÇϱâ
2,362
ÇöÀç Æ®·¡ÇÈ Ãâ·ÂÇϱâ
2,361
¹®ÀÚ¿­ ó¸® ÇÔ¼ö + ÆÄÀÏ Ã³¸® ÇÔ¼ö
2,360
(ÇÔ¼ö) max(°¡ÀåÅ« ¼ö),min(°¡Àå ÀÛÀº¼ö),sin,cos,tan,asin,acos,atan
2,359
php ¹®ÀÚ¿­ ÇÔ¼ö
2,358
Input ÇѱÛ/¿µ¾î Á¦¾îÇϱâ
2,357
ÅؽºÆ® ¾ÏȣȭÇϱâ
2,356
ÀÚµ¿À¸·Î ¹Ì¸®º¸±â °¡´ÉÇÑ Å±׿¬½ÀÀå
2,355
ÅÂ±× ½ºÅ©¸³Æ® ¾ÏȣȭÇϱâ
2,354
ÅÂ±× ½ºÅ©¸³Æ® ¾Ïȣȭ 2
2,353
½ºÆÔ¸·±â À̸ÞÀÏ ¸µÅ© ¼Ò½º »ý¼º±â
2,352
¸¶ÄûÅÂ±× marquee »ý¼º±â
2,351
Æ˾÷ »õâ¼Ò½º »ý¼º±â
2,350
Æ˾÷ »õâ¼Ò½º ¸¶¹ý»ç
2,349
Æû(ÀԷ¹ڽº ¹öÆ° µî) »ý¼º ¸¶¹ý»ç
2,348
HTML -> ÀÚ¹Ù½ºÅ©¸³Æ® Javascript º¯È¯±â
2,347
byte,kbyte,Mbyte,Gbyte ¹ÙÀÌÆ® º¯È¯
2,346
ÇÑ±Û ÀÚ¸£±â ÇÒ¶§¿¡ ±úÁö´Â Çö»óÀÌ ¹ß»ýÇÒ°æ¿ì
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.