function write_log($path = '/...log') {ob_start();echo "\n--------------------------------------------------------------------------------\n";echo "TIME - IP\t: " . date("Y-m-d h:i:s - ") .$_SERVER['REMOTE_ADDR'] . "\n";echo "DEBUG FILE\t: " . str_replace($_SERVER['DOCUMENT_ROOT'], '', __FILE__) . "\n";echo "SCRIPT_NAME\t: " . $_SERVER['SCRIPT_NAME'] . "\n";echo "PHP SELF\t: " . $_SERVER['PHP_SE..
function array_to_field($array) {$res = array('combine' => array(),'field' => array(),'value' => array()); foreach ($array as $key => $value) {if($value === null) {$value = 'null';} else if(!in_array($value, array('NOW()'))) {$value = "'" . addslashes($value) . "'";}array_push($res['combine'], "`{$key}` = {$value}");array_push($res['field'], "`{$key}`");array_push($res['value'], $value);}$res['c..
PHP:function pagination($page, $total, $list_size = 10) {$end_page = min(($start_page = max(($page = isset($page) && is_numeric($page) && $page > 0 ? $page : 1) - 4, $min_page = 1)) + 8, $max_page = $total ? ceil($total / $list_size) : 0); unset($_GET['page']);$gets = (sizeof($_GET) ? '&' : '') . http_build_query($_GET);$res = '';if($start_page > $min_page) { $res .= '«'; }for($i = $start_page; $i
출처 : http://blog.bloodcat.com/277
header('Access-Control-Allow-Origin: domain or *');
dechex()hexdec()decbin() decoct() ※ base_convert()
class Mail {/* $senderName = '웹마스터'; $senderEmail = 'webmaster@webmaster.org'; $toName = 'Sender'; $toEmail = 'webmaster@webmaster.org'; $subject = '제목'; $content = '내용'; $filePath = array('file1', 'file2'); $cc = ''; $bcc = ''; Mail::sendMail($senderName, $senderEmail, $toName, $toEmail, $subject, $content, $filePath, $cc, $bcc); */ public static function prepareAttachment($path) { if (file..
function subString($str, $firstStr, $lastStr, $offset = 0, $full = true) {$subStr = '';if(ereg($firstStr, $str) && ereg($lastStr, $str)) {$startPos = strpos($str, $firstStr, $offset) + strlen($firstStr);$endPos = strpos($str, $lastStr, $startPos) - $startPos;$subStr = substr($str, $startPos, $endPos);if($full) {$subStr = $firstStr . $subStr . $lastStr;}}return $subStr;} function eSubString($str,..