3/4 페이지 열람 중
javascript를 이용하여 xml을 obj로 변환(파싱)Naver에서 공개한 xml2obj.js입니다.DOM을 사용하여 파싱할 경우 속도가 느리기 때문에 정규식을 이용 파싱합다.특수문자의 제한이 있을 수도 있겠네요.<html> <head> <meta http-equiv="content-type" content="text/html; charset=euc-kr"> <title>xml2obj.js</title> <script type=…
php 소스 압축 함수 php_strip_whitespacejs나 css는 Minnify이나 jsmin과 같은 유틸을 이용하여 용량을 줄일 수 있습니다.그럼 php는 php_strip_whitespace로 줄일 수 있습니다.php_strip_whitespace (PHP 5) - Return source with stripped comments and whitespacestring php_strip_whitespace ( string $filename ) Returns the PHP source code in filename wit…
[Function] ip2long, long2ipip2long ? Converts a string containing an (IPv4) Internet Protocol dotted address into a proper addressex)<?php $ip = gethostbyname('www.example.com'); $long = ip2long($ip) if ($long == -1 || $long === FALSE) { echo 'Invalid IP, please try again'…
Minnify 를 이용하여 javascript 압축하여 페이지 속도 높이기자바스크립트의 주석, 공백을 제거하여 로딩속도를 높이는 방법입니다.또한 JSMin 라이브러리를 사용하며, 자동으로 CSS 파일이 들고 있는 이미지 경로명을 교체할 수 도 있습니다.Minify는 PHP 5.2.1이상에서 작동합니다. 그러나 PHP 4 에서 도 사용할 수 있는 버전도 존재합니다.Before Minify <html> <head> <title>Example Page</title> <li…
javascript 과 css 파일 결합 압축하여 페이지 속도 올리기Make your pages load faster by combining and compressing javascript and css files브라우저가 한정된 수만을 동시에 전송하는데에서 착안하여 prototype 과 scriptaculous 와 같이 큰파일들을 서로 묶어서 전송하는 방법 입니다. Take for example the following URLs:http://www.creatype.nl/javascript/prototype.jshttp://www.…
[Class]zip 파일로 압축http://maniacamp.com/lib/class.ZipFile.phps<?php /* $Id: zip.lib.php,v 1.6 2002/03/30 08:24:04 loic1 Exp $ */ /** * Zip file creation class. * Makes zip files. * * Based on : * * http://www.zend.com/codex.php?id=535&single=1 * By Eric Mueller <eric@themepark.com> * * h…
IP2Nation - ip address에 따른 나라 출력mysql 데이터베이스에 ip에 따른 나라 코드를 넣어두고 php로 ip address를 받아 그에 따른 나라 코드를 반환 하는 소스입니다. 응용하시면 잼 나는 것들을 많이 만들 수 있을 것 같습니다.예를 들어 다국어를 지원하는 홈페이지이면 그에 따른 언어를 출력 할 수 있겠죠!!이 소스는 다음 홈페이지에서 구할 수 있습니다.Output full country name http://www.ip2nation.com/ip2nation/Sample_Scripts/Output_Ful…
[Function] strpos, strrpos, stripos, strrchr, stristr, strstr 문자열 찾기strpos(PHP 3, PHP 4 , PHP 5)strpos -- 문자열이 처음 나타나는 위치를 찾습니다. 설명int strpos ( string haystack, string needle [, int offset])haystack 문자열에서 needle이 처음 나타나는 수 위치를 반환합니다. strrpos()와는 달리, 이 함수는 needle 인자로 완전한 문자열을 받아서 전체 문자열을 사용합니다. needl…
javascript 에서 php 실행하고 결과값 리턴 받기..(리프레쉬 없이)아래소스는 서버에서 시간 값을 읽어서 화면에 1초 단위로 뿌려 줍니다# index.htm 파일 <html> <body onload="time();"> <script id="dynamic"></script> <script> var data= 0; function time() { data += 1; …
내가 개발하는 사이트는 UTF-8이다.하지만, POST로 값을 넘겨야 하는 사이트는 EUC-KR이다..영어야 상관없지만, 한글의 경우 절망하게 된다.Firefox는 form에 accept-charset을 지정하면 되지만, IE에서는 accept-charset을 무시한다. (나쁜 x)그러나 하늘이 무너져도 솟아날 구멍은 있는 법. <form name="frmTest" id="frmTest"method="post" target="_blank"action=…