삼항 연산자 50 ? 'Passed' : $tmp; $action = (empty($_POST['action'])) ? 'default' : $_POST['action'];?> [ Web 관련 ]/php 2021. 9. 1. 15:09
Json 추출 - jQuery, 자바스크립트 + key 갯수 구하기 jQuery var json = { 'NAME':'홍길동', 'SEX':'남', 'AGE':'99세'}; $.each(json, function(key, value){ alert('key:' + key + ' / ' + 'value:' + value); }); Javascript var json = { 'NAME':'홍길동', 'SEX':'남', 'AGE':'99세'}; for(key in json) { alert('key:' + key + ' / ' + 'value:' + json[key]); } 일반적으로 배열 내 원소의 개수를 구할 땐 배열명.length 를 쓰면 간단히 구할 수 있는데, {키:값} 쌍으로 이루어진 JSON 형식의 오브젝트는 length로는 엘리먼트의 개수가 나오지 않음. var e.. [ Web 관련 ]/jQuery 2021. 8. 24. 19:00
jQuery 데이터 테이블 리스트 플러그인 (정렬, 검색, 페이징) https://cloudtables.com/ CloudTables Easily embed CloudTables in your web-site or app Seamless integration with your pages is straightforward with CloudTables through its extensive support for the most popular styling frameworks, such as Bootstrap and Semantic UI. It is actually part of your cloudtables.com https://datatables.net/examples/index DataTables examples - Examples index Examples index.. [ Web 관련 ]/jQuery 2021. 8. 13. 18:07
변수 이름 규칙 Naming Rule PascalCasing (파스칼 케이싱) ■ 클래스, 열거형, 이벤트, 메서드 등의 이름을 만들 때에는 대문자로 시작하는 변수명을 사용한다. ■ 복합어일 경우 중간에 시작하는 새로운 단어는 대문자로 적는다. 예) UtilityBox, MainFrame CamelCasing (카멜 케이싱) ■ 메서드의 매개변수의 이름에 적용되는데 첫번째 문자는 소문자로 시작하고 복합어 일 경우 파스칼 케이싱과 동일하게 적용한다. ■ 동일한 이름을 가지는 두 항목을 구분하는 용도로도 사용한다. 예) utilityBox, mainFrame GNU Naming Convention ■ Linux의 프로젝트들은 GNU Naming Convention이라는 형태의 명명법을 주로 사용한다. ■ 모두 소문자를 사용.. 기타자료 2021. 8. 9. 11:28
php 요일 구하기, 현재 날짜 시간 echo "현재 날짜 : ". date("Y-m-d")." "; echo "현재 시간 : ". date("H:i:s")." "; echo "현재 일시 : ". date("Y-m-d H:i:s")." "; $day = "2010-09-01"; $yoil = array("일","월","화","수","목","금","토"); echo($yoil[date('w', strtotime($day))]); [ Web 관련 ]/php 2021. 8. 6. 15:38
php JSON 한글 인코딩 //JSON으로 변경 $jsonData = json_encode($naverArr, JSON_UNESCAPED_UNICODE); [ Web 관련 ]/php 2021. 8. 4. 18:29
★ php 정규식 ★ TEXTAREA 제거 $content = preg_replace("!!is","[TEXTAREA]",$content); $content = preg_replace("!!is","[/TEXTAREA]",$content); script 제거 $str=preg_replace("!\"']+)[\"']?[^>]*>/i",$str,$RESULT); preg_match_all("/]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i",$str,$RESULT); a 태그에서 title 추출 $pattern ="/]*title=[\"']?([^>\"']+)[\"']?[^>]*>/i"; a 태그에서 href 추출하는데 특정 순서만 $pattern ='/(href=)(\'|\")?([^\s\'\"]*)(\'|.. [ Web 관련 ]/php 2021. 7. 28. 17:42
웹스토리지, 세션스토리지 * 웹스토리지, 세션스토리지는 문자형(string) 데이터 타입만 지원 (JSON 형태로 데이터를 저장하는 방법이 유용함) 웹스토리지 // 키에 데이터 쓰기 localStorage.setItem("key", value); // 키로 부터 데이터 읽기 localStorage.getItem("key"); // 키의 데이터 삭제 localStorage.removeItem("key"); // 모든 키의 데이터 삭제 localStorage.clear(); // 저장된 키/값 쌍의 개수 localStorage.length; JSON 저장시 localStorage.setItem('json', JSON.stringify({a: 1, b: 2})) JSON.parse(localStorage.getItem('json')).. [ Web 관련 ]/자바스크립트 2021. 7. 28. 14:20
php 배열의 정렬 - 1차원 배열, 다차원 배열 $naverArr = array(); $naverArr['A'][0] = 'AA'; $naverArr['A'][1] = 1; $naverArr['B'][0] = 'BB'; $naverArr['B'][1] = 4; $naverArr['C'][0] = 'CC'; $naverArr['C'][1] = 3; $naverArr['D'][0] = 'DD'; $naverArr['D'][1] = 2; print_r($naverArr); echo " "; foreach ((array) $naverArr as $key => $value) { $sort[$key] = $value[1]; } array_multisort($sort, SORT_ASC, $naverArr); print_r($naverArr); 참조 https://.. [ Web 관련 ]/php 2021. 7. 26. 23:55
주식 미니 위젯 (데스크탑) http://www.cross100.com/ 주식위젯 CROSS100 실시간 주식시세,바탕화면 주식시세,pc주식시세,주식위젯,증시 지수,주가정보,증권시세,PC,데스크탑,바탕화면,가젯,주식창,cross100.com,코인위젯,비트코인,이더리움,리플,코인시세,코인실시간,업 www.cross100.com Adobe AIR 설치 필요 기타자료 2021. 7. 23. 10:24