티스토리 뷰
echo __DIR__; //현재 디렉토리 경로 hr(); echo TRUE ?: FALSE; // TRUE hr(); echo FALSE ?: TRUE; // FALSE; hr(); echo "" ?: "1"; //1; hr(); echo "" ?: "2"; //2; hr(); print_r( array()?:array(1) ); //Array ( [0] => 1 ) hr(); echo strlen("")?: strlen("a"); //1 hr("Double Encoding"); $FOO = "BAR > FOO & THAT"S ALL"; echo "
"; echo htmlspecialchars($FOO, ENT_COMPAT, 'UTF-8'); echo "
"; echo htmlentities($FOO, ENT_COMPAT, 'UTF-8'); //==> BAR > FOO && THAT&"S ALL echo "
"; echo htmlspecialchars($FOO, ENT_COMPAT, 'UTF-8', false); echo "
"; echo htmlentities($FOO, ENT_COMPAT, 'UTF-8', false); //==> BAR > FOO &; THAT"S ALL hr("Date Parsing"); $date = date_create_from_format("Y-m-d", "2011-06-30"); var_dump( date_format($date, 'F d, Y') ) ; // 'June 30, 2011' /* // 세션 랜성 생성을 고치다. /DEV/URANDOM SESSION.ENTROPY_FILE = __DIR__ // /DEV/URANDOM SESSION.ENTROPY_LENGTH = 32; //JAVASCRIPT 쿠기, 세션 SESSION.USE_ONLY_COOKIES = 1; SESSION.COOKIE_HTTPONLY = 1; */ //SPL TRICKS ; hr(); //간단하 재귀 디렉토리 탐색 foreach( new RECURSIVEITERATORITERATOR ( new RECURSIVEDIRECTORYITERATOR('.') ) as $file ) { echo $file , "\n"; }; hr(); //재귀 디렉토리 매취 여행 $IT = new RECURSIVEITERATORITERATOR( new RECURSIVEDIRECTORYITERATOR('.') ); $Regx = new Regexiterator( $IT, '/^.*\.PHP$/i', Recursiveregexiterator::GET_MATCH ); foreach ( $Regx as $file ) { echo $file[0] , "\n"; }; // IGBINARY 감탐한 PHP SERIALIZER // 빠르다 , MORE COMPACT // EXTENSION = IGBINARY.SO // SESSION.SERIALIZE_HANDLER = IGBINARY // http://GITHUB.COM/PHADEJ/IGBINARY /* serialize ( $_SERVER ); ini_set( "IGBINARY.COMPACT_STRINGS", 0); IGBINARY_SERIALIZE($_SERVER); ini_set("IGBINARY.COMPACT_STRINGS", 1); IGBINARY_SERIALIZE($_SERVER); // UN-SERIALIZE IGBINAY_UNSERIALIZE($X); */ // XHPROF // 가볍운 php 프로파일러 // HTTP://PECL.PHP.NET/PACKAGE/XHPROF // HTTP://GITHUB.COM/PREINHEIMER/XHPROF /* AUTO_PREPEND_FILE = /XHPROF/EXTERNAL/HEADER.PHP include_once __DIR__ . '/XHPROF_LIB/CONFIG.PHP'; include_once __DIR__ . '/XHPROF_LIB/UTILS/XHPROF_LIB.PHP'; include_once __DIR__ . '/XHPROF_LIB/UTILS/XHPROF_RUNS.PHP'; XHPROF_ENABLE( XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); AUTO_APPEND_FILE = /XHPROF/EXTERNAL/FOOTER.PHP $XHPROF_DATA = XHPROF_DISABLE(); $XHPROF_RUNS = NEW XHPROFRUNS_DEFAULT(); $XHPROF_RUNS->SAVE_RUN( $XHPROF_DATA, 'APPNAME', NULL, $_XHPROF); */
'웹개발 > Php' 카테고리의 다른 글
PHP 비트 연산자 사용. (0) | 2011.07.17 |
---|---|
HTTP 1.1의 Content Length와 Transfer Encoding (0) | 2011.07.11 |
PHP 데코레이터 패턴 !!!! (0) | 2011.06.14 |
페이지 네이비게이션 ...형식 (0) | 2011.06.09 |
Kohana3 - 연구 (0) | 2011.06.08 |
댓글