본문 바로가기

분류 전체보기

[PHP] UTF-8 을 EUC-KR로 변환 하기 iconv 함수 쓸때 //IGNORE 를 안붙여주면 내용이 짤리는 경우가 있다. 꼭 넣어주자.
[PHP] 파일 UTF-8로 저장하기 출처 : http://www.codingforums.com/showthread.php?t=129270
[PHP] 파일 다운로드 $justfilename = 'abc.pdf';       $filefullpath = '/home/you/file/path/'. justfilename;header('Content-type: application/x-unknown');header("Content-Disposition: attachment; filename=\"".$justfilename."\";");readfile($filefullpath);
[MySql] delete mysql 은 from절을 꼭 넣어줘야 삭제가 된다... 망할...delete from table_temp where t_id = 444
[MySql] null 확인 함수 * IFNULL(필드, 표현) select id, ifnull(read_count, 0) from board
[PHP] 파일 사이즈 단위 출력하기 $filesize = 17878788; $result = null;    if ($filesize         $result = round(($filesize / 1024), 2) . 'KB';     else if ($filesize         $result = round(($filesize / 1048576), 2) . 'MB';    else        $result = round(($filesize / 1073741824), 2) . 'GB';    echo $result;
[PHP] JSON 사용 $arr_data = array('사과' => '맛있어', '기차' => '길어', '비행기' => '빨라', '태극기' => '바람에 펄럭입니다');$json_encode_value = json_encode($arr_data);  //json 형식으로 변환하기 echo print_r($json_encode_value);echo "";echo "";$json_decode_value = json_decode($json_encode_value); //json문자열을 클래스 형식으로 리턴//$json_decode_value = json_decode($json_encode_value, true); //json문자열을 배열 형식으로 리턴echo print_r($json_decode_va..
[PHP] 난수 생성 mt_srand(time()%2147 * 1000000 + (double)microtime() * 1000000);echo mt_rand(100000, 999999);