Programming/PHP (7) 썸네일형 리스트형 [PHP]homestead and vagrant setting command 1. vagrant up : 시작 2. vagrant suspend : 일시정지 3. vagrant halt : 종료 4. vagrant reload --provision : yaml 설정 변경 후 반영할 때 사용 homestead.yaml 1. 대소문자 구분 : code 와 Code 는 다른 경로 [PHP] HTML to Excel 개행 처리(단순 br로는 엑셀에서 개행처리 되지 않습니다.) [PHP]htmlspecialchars에 대해 아마 htmlspecialchars 사용해 보신 분들은 &#로 변형되는 글자 때문에 고민하셨으리라 생각합니다. 이경우 보통 str_replace로 하나하나 바꿔주었죠. str_replace를 사용하는 방법도 있지만 모르시는 분들을 위해 다른 방법을 소개할까 합니다. function htmlspecialchars2($s) { return(strtr($s, array('&#' => '&#', '&' => '&', '"' => '"', ''))); } 어느게 더 빠른지 테스트나 해봐야겠네요. 그럼... 자료출처: http://www.nzeo.com/bbs/zboard.php?id=p_study&no=786 ##########################################################.. [PHP]트랜잭션 mysql_query("SET AUTOCOMMIT=0", $DB); mysql_query("begin", $DB); $SQL = " DELETE FROM " . $table . " WHERE NO = " . $R_NO . " "; //echo "SQL = " . $SQL . " "; mysql_query($SQL, $DB); if (mysql_errno() != 0) { $StrErrorMsg = mysql_error(); mysql_query("rollback", $DB); mysql_close($DB); ?> [PHP]파일다운로드 $dnfile = $file; //실제 파일명 또는 경로 if(eregi("(MSIE 5.0|MSIE 5.1|MSIE 5.5|MSIE 6.0)", $HTTP_USER_AGENT)) { if(strstr($HTTP_USER_AGENT, "MSIE 5.5")) { header("Content-Type: doesn/matter"); header("Content-disposition: filename=$dnfile"); header("Content-Transfer-Encoding: binary"); header("Pragma: no-cache"); header("Expires: 0"); } if(strstr($HTTP_USER_AGENT, "MSIE 5.0")) { Header("Content-type: fil.. [PHP]함수 //모든상수출력print_r(get_defined_constants(true));//모든변수출력 function array_prt($arr,$lv) { $tab = ""; for($i=0;$i //php-extract function extract(array $data){ foreach($data as $key => $val){ $$key = $val; } } /*** SQL Injection 방지 ***/ function mysql_save($str) { if(is_numeric($str)) $ret = $str; else $ret = mysql_real_escape_string(htmlspecialchars(trim($str))); return $ret; } /*** 역슬래시(\) 제거 ***/ fu.. [PHP]인터넷 환경설정 - 페이지를 열때마다(자동 캐싱) header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache");header ("Expires: 0");?> 이전 1 다음