<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>에그당</title>
<link>http://clan.pe.kr/</link>
<description>에그당</description>
<language>ko</language>
<item>
<title>전화 번호, 이메일주소 가리기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=1264</link>
<description><![CDATA[<span><p><span style="line-height: 190%;" id="writeContents">
<p><span style="font-size: 12px;" id="writeContents">&lt;?<br />
$s =  &quot;02-123-4567 <a target="_blank" href="mailto:kag@naver.com">kag@naver.com</a>&quot;;<br />
$s  = preg_replace(&quot;/([0-9]{2,3}[- \.\/])?[0-9]{3,4}[- \.\/][0-9]{4}/&quot;,   &quot;&lt;font color=silver&gt;*** 내용에 들어있는 전화번호는 자동으로 보여지지 않습니다   ***&lt;/font&gt;&quot;, $s);<br />
$s =   preg_replace(&quot;/(([a-z0-9_]|\-|\.)+#([^[:space:]]*)([[:alnum:]-]))/i&quot;,   &quot;&lt;font color=silver&gt;*** 내용에 들어있는 메일주소는 자동으로 보여지지 않습니다   ***&lt;/font&gt;&quot;, $s);<br />
$s = preg_replace(&quot;/&lt;a   href\=\'mailto\:(([a-z0-9_]|\-|\.)+@([^[:space:]]*)([[:alnum:]-]))\'\&gt;/i&quot;,   &quot;&lt;font color=silver&gt;*** 내용에 들어있는 메일주소는 자동으로 보여지지 않습니다   ***&lt;/font&gt;&quot;, $s);<br />
$s =   preg_replace(&quot;/(([a-z0-9_]|\-|\.)+@([^[:space:]]*)([[:alnum:]-]))&lt;\/a&gt;/i&quot;,   &quot;&quot;, $s);<br />
echo $s;<br />
?&gt;</span></p>
</span></p>
<!-- 테러 태그 방지용 --></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Fri, 07 May 2010 00:12:24 +0900</dc:date>
</item>
<item>
<title>이번달 달력 출력</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=10</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;"><span style="font-size: 12px;" id="writeContents">
<p>&lt;?php<br />
define(  'wlen', 7);</p>
<p>list( $now_yy, $now_mm, $now_dd)=explode( '-',  date('Y-m-d'));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //echo $now_yy,$now_mm,$now_dd;<br />
list( $wpos,  $mlast)=explode( '-', date('w-t', mktime( 0, 0, 0, $now_mm, 1,  $now_yy))); //mktime: any arguments thus omitted will be set to the  current value according to the local date and time.<br />
$wpos=(int)$wpos;<br />
$mlast=(int)$mlast;</p>
<p>echo'&lt;table border=&quot;1&quot;&gt;&lt;tr&gt;';<br />
for( $wi=0; $wi &lt;  $wpos; $wi++) echo '&lt;td&gt;&amp;nbsp;&lt;/td&gt;';</p>
<p>for( $di=1; $di&lt;= $mlast; $wi++, $di++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(  $wi%wlen==0)echo'&lt;/tr&gt;&lt;tr&gt;';<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo  '&lt;td&gt;',$di,'&lt;/td&gt;';<br />
}</p>
<p>for( $ri=$wi%wlen; $ri&lt;wlen; $ri++) echo  '&lt;td&gt;&amp;nbsp;&lt;/td&gt;';</p>
<p>echo '&lt;/tr&gt;&lt;/table&gt;';<br />
?&gt;</p>
</span></span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:39:36 +0900</dc:date>
</item>
<item>
<title>올바른 확장자인가? gif,png,zip,jpg</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=8</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;">
<p>머리속에 갑자기 방법이 떠올라 가장  많이 쓰이는 jpg,gif,png,zip 만 해서 파일 확장자가 맞게 되어 있는지를 검사하는 함수를 만들어 보았습니다. 만일  스크립트 파일을 확장자를 이미지 확장자로 바꾼다할 지라도 유효성 검사에서 실패하겠죠. <br />
<br />
function  validate_ext($file, $ext=&quot;gif&quot;)<br />
{<br />
&nbsp;$ext = strtolower($ext);<br />
&nbsp;if  (!in_array($ext, array('jpg', 'jpeg', 'png', 'gif', 'zip'))) {<br />
&nbsp;&nbsp;return  false;<br />
&nbsp;}</p>
<p>&nbsp;if ($fp = fopen($file, 'rb')) {<br />
&nbsp;&nbsp;$c&#111;&#110;tents =  base64_encode(fread($fp, 30));<br />
&nbsp;&nbsp;fclose($fp);<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;switch  ($ext) {<br />
&nbsp;&nbsp;&nbsp;case 'jpeg':<br />
&nbsp;&nbsp;&nbsp;case 'jpg': $pattern =  &quot;/^\/9j\/4AAQSkZJRgABA/&quot;; break;<br />
&nbsp;&nbsp;&nbsp;case 'png': $pattern =  &quot;/^iVBORw0KGgoAAAANSUhEUgAAA/&quot;; break;<br />
&nbsp;&nbsp;&nbsp;case 'gif': $pattern =  &quot;/^R0lGODlh/&quot;; break;<br />
&nbsp;&nbsp;&nbsp;case 'zip': $pattern = &quot;/^UEsDBBQABAAIA/&quot;;  break;<br />
&nbsp;&nbsp;}</p>
<p>&nbsp;&nbsp;if (preg_match($pattern, $contents)) {<br />
&nbsp;&nbsp;&nbsp;return true;<br />
&nbsp;&nbsp;}<br />
&nbsp;}</p>
<p>&nbsp;return false;<br />
}<br />
<br />
예를 들어 validate_ext('path/to/img.gif',  'gif') 검사를 했을 때 올바른 확장자의 파일일 경우 true값이 리턴됩니다.<br />
<br />
시간나면 다른 확장자들도 추가해야  겠네요.</p>
</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:36:51 +0900</dc:date>
</item>
<item>
<title>이 번 달 일 수 구하기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=7</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;">
<p>// 년이 없다면 이번 년<br />
&nbsp;if  (!$year)<br />
&nbsp;&nbsp;$year = date(&quot;Y&quot;);</p>
<p>&nbsp;// 달이 없다면 이번 달<br />
&nbsp;if (!$month)<br />
&nbsp;&nbsp;$m&#111;&#110;th = date(&quot;m&quot;);</p>
<p>&nbsp;// 현재 $month 달의 일수 구하기<br />
&nbsp;for ($i=1; $i&lt;=32; $i++) {<br />
&nbsp;&nbsp;$check  = checkdate($month,$i,$year);<br />
&nbsp;&nbsp;if (!$check) {<br />
&nbsp;&nbsp;&nbsp;$day = $i - 1;<br />
&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;&nbsp;}<br />
&nbsp;}<br />
<br />
echo  &quot;음... 이번달은 &lt;b&gt;&quot;&nbsp;. $day . &quot;&lt;/b&gt; 일 까지 있네요...&quot;; // &lt;- 이번달은  몇일 까지 잇을까?</p>
</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:35:24 +0900</dc:date>
</item>
<item>
<title>절대경로알아내기 함수</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=6</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;">function  get_absolute_path($path) { <br />
&nbsp; &nbsp; $path = str_replace(array('/', '\\'),  DIRECTORY_SEPARATOR, $path); <br />
&nbsp; &nbsp; $parts =  array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); <br />
&nbsp; &nbsp;  $absolutes = array(); <br />
&nbsp; &nbsp; foreach ($parts as $part) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; if  ('.' == $part) continue; <br />
&nbsp; &nbsp; &nbsp; &nbsp; if ('..' == $part) { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; array_pop($absolutes); <br />
&nbsp; &nbsp; &nbsp; &nbsp; } else { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $absolutes[] = $part; <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; } <br />
&nbsp; &nbsp; return  implode(DIRECTORY_SEPARATOR, $absolutes); <br />
}         </span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:33:57 +0900</dc:date>
</item>
<item>
<title>디렉토리 사이즈 구하기 #2 단위별로</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=5</link>
<description><![CDATA[<span><p>추가 팁으로 아래 함수를 이용하시면 단위 표출도 처리도 쉽게될것입니다. <br />
<br />
$size 에는 byte단위의 용량을 넣으시면 될 것입니다. <br />
<br />
function formatSize($size){ <br />
&nbsp; &nbsp; switch (true){ <br />
&nbsp; &nbsp; case ($size &gt; 1099511627776): <br />
&nbsp; &nbsp; &nbsp; &nbsp; $size /= 1099511627776; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $suffix = 'TB'; <br />
&nbsp; &nbsp; break; <br />
&nbsp; &nbsp; case ($size &gt; 1073741824): <br />
&nbsp; &nbsp; &nbsp; &nbsp; $size /= 1073741824; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $suffix = 'GB'; <br />
&nbsp; &nbsp; break; <br />
&nbsp; &nbsp; case ($size &gt; 1048576): <br />
&nbsp; &nbsp; &nbsp; &nbsp; $size /= 1048576; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $suffix = 'MB';&nbsp; &nbsp;  <br />
&nbsp; &nbsp; break; <br />
&nbsp; &nbsp; case ($size &gt; 1024): <br />
&nbsp; &nbsp; &nbsp; &nbsp; $size /= 1024; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $suffix = 'KB'; <br />
&nbsp; &nbsp; &nbsp; &nbsp; break; <br />
&nbsp; &nbsp; default: <br />
&nbsp; &nbsp; &nbsp; &nbsp; $suffix = 'B'; <br />
&nbsp; &nbsp; } <br />
&nbsp; &nbsp; return round($size, 2).$suffix; <br />
}</p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:32:57 +0900</dc:date>
</item>
<item>
<title>디렉토리 사이즈 구하기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=4</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;">// 디렉토리의 용량 (KB)<br />
//  <a target="_blank" href="http://kr.php.net/manual/kr/function.filesize.php">http://kr.php.net/manual/kr/function.filesize.php</a>&nbsp;&nbsp; <br />
function  get_dir_size($path)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br />
&nbsp;&nbsp;&nbsp; $result=explode(&quot;\t&quot;,exec(&quot;du -k -s &quot;.$path),2);<br />
&nbsp;&nbsp;&nbsp; return  ($result[1]==$path ? $result[0] : &quot;error&quot;); <br />
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;          </span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:31:05 +0900</dc:date>
</item>
<item>
<title>원하는 tag만 제거하기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=3</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;"><span class="ct lh" id="writeContents" style="font-size: 12px;">
<p style="margin: 0px;"><font face="GulimChe"><span class="keyword">function  </span><span class="default">strip_only</span><span class="keyword">(</span><span class="default">$str</span><span class="keyword">, </span><span class="default">$tags</span></font><font face="GulimChe"><span class="keyword">) {<br />
&nbsp;&nbsp;&nbsp; if(!</span><span class="default">is_array</span><span class="keyword">(</span><span class="default">$tags</span></font><font face="GulimChe"><span class="keyword">)) {<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; </span><span class="default">$tags </span><span class="keyword">= (</span><span class="default">strpos</span><span class="keyword">(</span><span class="default">$str</span><span class="keyword">, </span><span class="string">'&gt;'</span><span class="keyword">) !== </span><span class="default">false </span><span class="keyword">? </span><span class="default">explode</span><span class="keyword">(</span><span class="string">'&gt;'</span><span class="keyword">, </span><span class="default">str_replace</span><span class="keyword">(</span><span class="string">'&lt;'</span><span class="keyword">, </span><span class="string">''</span><span class="keyword">, </span><span class="default">$tags</span><span class="keyword">)) : array(</span><span class="default">$tags</span></font><font face="GulimChe"><span class="keyword">));<br />
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; if(</span><span class="default">end</span><span class="keyword">(</span><span class="default">$tags</span><span class="keyword">) == </span><span class="string">''</span><span class="keyword">) </span><span class="default">array_pop</span><span class="keyword">(</span><span class="default">$tags</span></font><font face="GulimChe"><span class="keyword">);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; foreach(</span><span class="default">$tags </span><span class="keyword">as </span><span class="default">$tag</span><span class="keyword">) </span><span class="default">$str </span><span class="keyword">= </span><span class="default">preg_replace</span><span class="keyword">(</span><span class="string">'#&lt;/?'</span><span class="keyword">.</span><span class="default">$tag</span><span class="keyword">.</span><span class="string">'[^&gt;]*&gt;#is'</span><span class="keyword">, </span><span class="string">''</span><span class="keyword">, </span><span class="default">$str</span></font><font face="GulimChe"><span class="keyword">);<br />
&nbsp;&nbsp;&nbsp; return </span><span class="default">$str</span></font><span class="keyword"><font face="GulimChe">;<br />
}</font></span></p>
</span></span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:28:40 +0900</dc:date>
</item>
<item>
<title>현재 접속자 수 체크하기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=2</link>
<description><![CDATA[<span><p>&lt;접속했을때&gt;<br />
1. 방문자가 사이트에 접속한다.<br />
2.방문자가 사이트에 접속하면 현재의 시간과 접속한 방문자의 IP를 체크한다.<br />
3.방문자의  IP를 이름으로 갖는 텍스트 파일을 생성한다.(생성시간은 방문자가 접속한 시간)<br />
4.다른 IP를 가진 사용자일경우 다른  파일로 생성될 것이기 때문에 파일의 개수를 세어 출력한다.<br />
<br />
&lt;떠났을때&gt;<br />
1.방문자가 사이트에  접속한다.<br />
2.방문자가 사이트에 접속하면 현재의 시간과 접속한 방문자의 IP를 체크한다.<br />
3.각 파일들의 생성 시간과  현재 시간과의 차가 20초 이상인 파일을 삭제한다. 즉 20초마다 refresh 하겠다는 말이다.<br />
4.위와 동일<br />
5.위 와 동일<br />
<br />
&lt;?<br />
$time = time();&nbsp;&nbsp;&nbsp;&nbsp;//현재의 시간 저장<br />
$ip =  $_SERVER[REMOTE_ADDR];&nbsp;&nbsp;&nbsp;&nbsp;//방문자 IP저장<br />
?&gt;<br />
<br />
$result =  opendir(&quot;now&quot;);&nbsp;&nbsp;&nbsp;&nbsp;//now에 있는 파일 꺼내기 (퍼미션주의)<br />
while($file =  readdir($result)){<br />
&nbsp;&nbsp;&nbsp;&nbsp;if($file == &quot;.&quot; || $file == &quot;..&quot;){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;&nbsp;&nbsp;&nbsp;&nbsp;// 파일 이름이 . 또는 ..일 경우에 무시하기( . 과 ..은&nbsp;경로이다)<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;$visit =  filemtime(&quot;now/$file&quot;);&nbsp;&nbsp;&nbsp;&nbsp;//파일의 생성시간 구하기<br />
&nbsp;&nbsp;&nbsp;&nbsp;$out = $time -  $visit;&nbsp;&nbsp;&nbsp;&nbsp;//방문자의 접속시간<br />
&nbsp;&nbsp;&nbsp;&nbsp;if($out &gt; 20){<br />
&nbsp;&nbsp;&nbsp;&nbsp;unlink(&quot;now/$file&quot;);&nbsp;&nbsp;&nbsp;&nbsp;// 접속유지 시간이 지난 사용자 삭제<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
<br />
$fp = fopen(&quot;now/$ip&quot;,  &quot;w&quot;);&nbsp;&nbsp;&nbsp;&nbsp;//(3)<br />
fwrite($fp, &quot;0&quot;);&nbsp;&nbsp;&nbsp;&nbsp;//파일의 내용이 무엇이 들어가건 상관없다.<br />
fclose($fp);<br />
<br />
&lt;Source&gt;<br />
&lt;?<br />
//////////////////////////////////<br />
//  1.방문자가 사이트에 접속한다.<br />
// 2.현재의 시간과 방문자의 IP체크<br />
// 3.각 파일들의 생성 시간과 현재  시간의 차가 20초 이상인 파일을 삭제<br />
// 4.IP를 이름으로 갖는 텍스트를 생성<br />
// 5.파일의 개수를 세어  출력한다.<br />
///////////////////////////////////</p>
<p>$time = time(); //현재 시간<br />
$ip = $_SERVER[REMOTE_ADDR];&nbsp;&nbsp;&nbsp; //IP Addr</p>
<p>$result = opendir(&quot;now&quot;);<br />
while($file = readdir($result)){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if($file == &quot;.&quot; || $file == &quot;..&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  $visit = filemtime(&quot;now/$file&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //파일의 생성시간<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $out =  $time - $visit;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(out&gt;20){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  unlink(&quot;now/$file&quot;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
}</p>
<p>$fp = fopen(&quot;now/$ip&quot;, &quot;w&quot;);<br />
fwrite($fp, &quot;0&quot;);<br />
fclose($fp);</p>
<p>$result = opendir(&quot;now&quot;);<br />
while($file = readdir($result)){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if($file==&quot;.&quot; || $file==&quot;..&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  $i++;<br />
}<br />
echo &quot;현재 접속자 수는 &lt;b&gt;$i&lt;/b&gt;명 입니다.&lt;br&gt;&quot;;</p>
<p>?&gt;</p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:27:26 +0900</dc:date>
</item>
<item>
<title>파일 생성시간으로부터 일정 시간이 지나면 파일 삭제하기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=php&amp;wr_id=1</link>
<description><![CDATA[<span><p><span id="writeContents" style="font-size: 12px;"><span id="writeContents" style="font-size: 12px;">특정 디렉토리의 파일을 검사하여 생성 시긴으로부터  일정 시간이 지나면 파일을 삭제합니다.<br />
<br />
<br />
function  timeover_file_del($dir,$del_time) {<br />
&nbsp;&nbsp;&nbsp; if (is_dir($dir)) {<br />
&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; $dh&nbsp; = @opendir($dir);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (false !== ($filename =  @readdir($dh))) {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $files[] = $filename;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; sort($files);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($files[2]) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  $time2=time();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for ($i=2;$files[$i];$i++){<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; $ftime=@filemtime($dir.'/'.$files[$i])+$del_time;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; if ($ftime&lt;=$time2) {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  @unlink($dir.'/'.$files[$i]);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @closedir($dh);<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
<br />
사용법</span><br />
<span id="writeContents" style="font-size: 12px;">timeover_file_del('경로','초단위  시간');</span><br />
<br />
<br />
예 제<br />
test폴더의  파일들을 검사하여 생성시간으로부터 30초가 지나면 파일을 삭제합니다.<br />
<span id="writeContents" style="font-size: 12px;">timeover_file_del($g4['path'].'/data/file/'.$bo_table.'/test',30);</span></span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>PHP</category>
<dc:date>Mon, 19 Apr 2010 14:26:45 +0900</dc:date>
</item>
<item>
<title>누 눌러보고싶다..♪</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=keke&amp;wr_id=2</link>
<description><![CDATA[<span><p><img src="http://editor.fileguri.com/editor/GetFile.asp?mnf=4%3FFCOM01%3F23%3F1711993%3F125847548497967.jpg" alt="" /> <br />
<embed type="application/x-shockwave-flash" src="http://pds16.egloos.com/pds/201002/21/56/banggu.swf" autostart="true" showstatusbar="true" volume="0"></embed>&nbsp; 브금이 왜딸려온건진 모르겠지만 뭐 그냥내버려두겠음<br />
출처 : <a href="http://www.battlepage.com/index.php?menu=d_humor">http://www.battlepage.com/index.php?menu=d_humor</a></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category></category>
<category>웃긴거 모을꺼얌</category>
<dc:date>Mon, 19 Apr 2010 11:08:04 +0900</dc:date>
</item>
<item>
<title>연예인과 군대</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=keke&amp;wr_id=1</link>
<description><![CDATA[<span>주영훈-조기흥분증후군 (그냥 흥분하면 기절하는 증상)<br/>김창렬-폐결핵 면제 (가수가 폐결핵)<br/>김종서, 신성우, 서태지-성격장애 (일명 정신병자)<br/>이재원-성격장애 및 자폐증<br/>조성모-연골수술땜시 안감 (드림팀 할 땐 펄펄 날던데)<br/>김민종-심장판막 질환 (호흡곤란한데 가수를)<br/>박형준-허리디스크 (드림팀에서 날고 길던)<br/>이상민-허리디스크 (룰라때 제일 날뛰던 춤꾼)<br/>김원준-좌견관절 재발성 탈구 (뼈가 달라붙았다 떨어졌다 함)<br/>박상민(장군의아들)-좌슬관절 불안정성(장군의아들에서 날라차기 할땐 언제고)<br/>장동건-기흉술휴 (이거 걸림 절때 못뜀...친구에서 책가방 옆에 끼고 엄청 뛰었음)<br/>한재석-사구체신염<br/>김현철-뇌경색 후유증<br/>은지원-정신질환 (언덕위에 하얀집 가야하는 병)<br/>김경호-간질병 (게거품무는 병)<br/>신혜성-무릎수술 군면제 (목표달성 서바이벌에서 달리고,춤구고,뒹굴고 했음)<br/>손지창-정신장애<br/>이하늘-부모이혼<br/>이성진-손수술 (주접떠는거 보면 정신병으로 면제받았을 듯)<br/>이현도-아르헨티나 국적 따고 군대안간다고 자랑했었음<br/>김종국-허리장애 (방송에서 가장 터프한 척 하는 연예인, 찢어죽일놈, 지금도 허리자랑)<br/>차태현-어깨탈골 (어겐투미에서 잘 돌아감)<br/>이지훈-어깨탈골 (산장미팅에서 통나무 위에서 베개싸움 열라 잘함)<br/>홍경인-원인불명<br/>유지태-허리가 아파서 면제<br/>조PD-유학파 (사회비판 가장 잘하면서 자기는 병역기피)<br/>유승준-한심한놈..동시에 다른놈들 생각하면 불쌍한놈<br/>윤태영(왕초에서 맨발역)-척추수술 (보나마나)<br/>안재모-원인모름 (야인시대에서는 날라다님)<br/>최수종-미국유학<br/>정우성-학력미달<br/>박해일-면제<br/>&nbsp;<br/><br/>신혜성-면제(역시 군면제의신화)<br/>이기찬-원인모름<br/>&nbsp;<br/><br/>라이머-허리<br/>최민수-면제 (모두 후까시였나?)<br/>소지섭-수영하는장애인<br/>김보성-말로만 의리.. 군대얘기나오면 오줌쌈<br/>임재범-마약, 형제(손지창)끼리 면제<br/>원타임-네명모두 군대 안감<br/>박중훈-마약<br/>이현우-미국시민권자.<br/>김동완-이유가 불분명(박순희들 가난때문변명, 그래서 첫날 루이비통가방들고 공익출근?)<br/>남궁민-공익<br/>&nbsp;<br/><br/>박진영-허리병자<br/>박용하-각막용하<br/>류시원-알만한놈임<br/>송일국-장군의손자좋아하네.. 똥싸라<br/>배용준, 박명수-시력으로 면제 (눈으로 면제면 장애인수준)<br/>하하-담배피는 천식병자<br/>김종민-공익<br/>션-공익<br/>이정진-공익<br/>강동원-공익(역시나 만만한 진단서병명, 어깨탈골)<br/>정재용-면제<br/>전진-면제? (눈이 맛갔다는 기사 나오더만, 자기입으로 현역간다고인터뷰..구라일듯)<br/>바비킴-면제<br/>드렁큰타이거-면제 (잘난 힙한전사들은 거의다 면제나 공익)<br/>고수-공익<br/>유재석-방위<br/>정준하-면제 (얘는 뭐냐?)<br/>이민우-공익 (여자질 할때만 어깨가붙는 변태인듯)<br/>환희-공익 (어깨장애인, 그래서 우결에서 오토바이타고 날아다니나봐 ㄷㄷ)<br/>박준형, 데니안(GOD), 타블로, 알렉스, 마르코, 다니엘헤니, 데니스오, 브라이언-외국인 (돈벌때만 한국사람)</span>]]></description>
<dc:creator>에그당</dc:creator>
<category></category>
<category>웃긴거 모을꺼얌</category>
<dc:date>Mon, 19 Apr 2010 10:55:44 +0900</dc:date>
</item>
<item>
<title>작업중인 게시판 다섯가지 리스트타입+다음오픈에디터</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=skin&amp;wr_id=1</link>
<description><![CDATA[<span>작업중인 게시판 다섯가지 리스트타입+다음오픈에디터</span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>그누보드 스킨</category>
<dc:date>Thu, 15 Apr 2010 18:15:52 +0900</dc:date>
</item>
<item>
<title>XHTML 시작과 끝</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=html&amp;wr_id=106</link>
<description><![CDATA[<span><h2>목차</h2>
<ol>
    <li><a href="#p1">XHTML 이란?</a></li>
    <li><a href="#p2">문서구조</a></li>
    <li><a href="#p3">한글표현과 인코딩</a></li>
    <li><a href="#p4">문법</a></li>
    <li><a href="#p5">디렉토리 표현방법</a></li>
</ol>
<p>&nbsp;</p>
<hr />
<h3>&nbsp;</h3>
<h3><a name="p1">1. XHTML 이란?</a></h3>
<p>XHTML 1.0 은 html 4.01 방식과 동일한 문서 구조를 갖는 xml 이다. 즉, html 이 아니며, xml 구조를 가져감으로써, PC 인터넷 환경을 떠나 모바일 등 많은 외부 머신에도 작동할 수 있는 유연함 및 확장성을 가지고 있다. 또한 dtd 추가 등으로 인해 문서 구조를 확장할 수 있는 이점도 있다.</p>
<p>&nbsp;</p>
<p>&nbsp;DOCTYPE 이란, 이 웹페이지가 어떠한 문서의 종류로 만들어졌는지를 말해주는 일종의 선언문이라고 할 수 있다. 사실 DOCTYPE은 쓰기가 좀 어렵다고 생각하는 사람들이 많아 그냥 지나칠 수 있는 부분이다. <br />
<br />
실제로 spell과 문서 종류가 무엇인지 확실하게 맞아야한다는 것을 명시하고 있기 때문에 그렇게 느낄 수 있는데, 몇 가지 문서 타입에 따른 DOCTYPE 태그만 알아두면 사용할 수 있을 것이다. <br />
<br />
만일 사용하지 않게 되었을 경우, 대부분은 전혀 상관이 없다!<br />
<br />
왜냐하면 페이지를 보여주어야 하는 브라우저는 그 웹페이지가 어떤 문서인지 모르지만, (어느 HTML버젼으로 만들어진지 모르지만,)<br />
<br />
호환모드(quirks mode)로 알아서 변환하여 보여주기 때문이다.</p>
<p>이 선언은 문서가 의거하는 DTD의 종류와 DTD를 찾을 수 있는 주소를 선언하는 것 DTD에 의거, 문서의 유효성을 점검하는 브라우저나 파서는 그 주소에서 DTD를 가져온다.</p>
<p>&nbsp;</p>
<p>DOCTYPE을 지정하지 않으면 IE는 쿼크모드로 랜더링 하게 되는데 이는 오래된 호환성 처리를 목적으로 하는 것이어서 쿼크모드에 의존하는 문서를 작성하는 것은 바람직하지 않다. 반드시 DOCTYPE을 지정하여 표준모드로 랜더링이 되도록 하는 것을 추천한다.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>월드와이드웹 컨소시엄(http://w3c.com) 추천 DTD목록</h4>
<p>HTML 4.01 Strict<br />
<br />
This DTD contains all HTML elements and attributes, but does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed.<br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;<br />
HTML 4.01 Transitional<br />
<br />
This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed.<br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br />
HTML 4.01 Frameset<br />
<br />
This DTD is equal to HTML 4.01 Transitional, but allows the use of frameset content.<br />
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; &quot;http://www.w3.org/TR/html4/frameset.dtd&quot;&gt;<br />
XHTML 1.0 Strict<br />
<br />
This DTD contains all HTML elements and attributes, but does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML.<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;<br />
XHTML 1.0 Transitional<br />
<br />
This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML.<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
XHTML 1.0 Frameset<br />
<br />
This DTD is equal to XHTML 1.0 Transitional, but allows the use of frameset content.<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;<br />
XHTML 1.1<br />
<br />
This DTD is equal to XHTML 1.0 Strict, but allows you to add modules (for example to provide ruby support for East-Asian languages).<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;</p>
<h3><a name="p2">2. 문서구조</a></h3>
<p>&nbsp;</p>
<h3><a name="p3">3. 한글표현과 인코딩</a></h3>
<p>&nbsp;</p>
<h3><a name="p4">4. 문법</a></h3>
<p>&nbsp;</p>
<h3><a name="p5">5. 디렉토리 표현방법</a></h3>
<p>&nbsp;</p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>Html</category>
<dc:date>Sat, 10 Apr 2010 14:01:08 +0900</dc:date>
</item>
<item>
<title>중앙정렬GNB반대</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=layout&amp;wr_id=5</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/layout/1846287335_H2P7YtC6_44.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>중앙정렬된 레이아웃에 GNB가 있고 LNB가 오른쪽으로간 형태</p>
<p><a class="button blue" target="_blank" href="http://clan.pe.kr/html/layouts/center+column+lnb+gnb(reverse).php"><span>예제 및 소스보기</span></a></p>
<p>&nbsp;</p>
<p><span>css layout</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>CSS 레이아웃</category>
<dc:date>Wed, 07 Apr 2010 18:09:22 +0900</dc:date>
</item>
<item>
<title>중앙정렬GNB</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=layout&amp;wr_id=4</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/layout/1846287335_rJ39M1yF_ECA491EC9599ECA095EBA0ACGNB.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>중앙정렬된 레이아웃에 GNB가 있고 LNB가 왼쪽으로간 형태</p>
<p><a target="_blank" href="http://clan.pe.kr/html/layouts/center+column+lnb+gnb.php" class="button blue"><span>예제 및 소스보기</span></a></p>
<p>&nbsp;</p>
<p><span>css layout</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>CSS 레이아웃</category>
<dc:date>Wed, 07 Apr 2010 17:50:26 +0900</dc:date>
</item>
<item>
<title>중앙정렬날개형</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=layout&amp;wr_id=3</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/layout/1846287335_egNB29th_33.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>중앙정렬된 레이아웃에 GNB가 있고 LNB와 ASIDE 가 양쪽에 배치된 형태</p>
<p><a href="http://clan.pe.kr/html/layouts/center+column+lnb+aside.php" target="_blank" class="button blue"><span>예제 및 소스보기</span></a></p>
<p>&nbsp;</p>
<p><span>css layout</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>CSS 레이아웃</category>
<dc:date>Wed, 07 Apr 2010 17:46:29 +0900</dc:date>
</item>
<item>
<title>중앙정렬기본(반대)</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=layout&amp;wr_id=2</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/layout/1846287335_jX9ZhEOR_22.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>중앙정렬된 레이아웃에 LNB가 오른쪽으로간 형태</p>
<p><a href="http://clan.pe.kr/html/layouts/center+column+lnb(reverse).php" target="_blank" class="button blue"><span>예제 및 소스보기</span></a></p>
<p>&nbsp;</p>
<p><span>css layout</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>CSS 레이아웃</category>
<dc:date>Wed, 07 Apr 2010 17:33:43 +0900</dc:date>
</item>
<item>
<title>중앙정렬기본</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=layout&amp;wr_id=1</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/layout/1846287335_e48EQCgj_11.jpg' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>중앙정렬된 레이아웃에 GNB가 있고 LNB가 왼쪽으로간 형태</p>
<p><a class="button blue" target="_blank" href="http://clan.pe.kr/html/layouts/center+column+lnb.php"><span>예제 및 소스보기</span></a></p>
<p>&nbsp;</p>
<p><span>css layout</span></p></span>]]></description>
<dc:creator>에그당</dc:creator>
<category>작업</category>
<category>CSS 레이아웃</category>
<dc:date>Wed, 07 Apr 2010 17:29:39 +0900</dc:date>
</item>
<item>
<title>파비콘 달기</title>
<link>http://clan.pe.kr/bbs/board.php?bo_table=tip&amp;wr_id=3</link>
<description><![CDATA[<span><img src='http://clan.pe.kr/data/file/tip/1270368595_C12PK7u6_aa.gif' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title=''><p><p>파비콘이라구 부르던가요?<br />
ico파일을 이용해서 즐겨찾기와 주소표시줄을 멋지게 꾸며준답니다 <br />
&nbsp;</p>
<p>&nbsp;</p>
<ol>
    <li>16*16 픽셀의 아이콘을 만듭니다. (16,16 아이콘이 아닌경우 인식 불가능)<br />
    ## 보통 BMP 로 저장 하시는게 좋습니다</li>
    <li>만들어진 아이콘을 자신의 계정에 올립니다.</li>
    <li>그리고 그 아이콘의 이름을 favicon.ico 라는 이름으로 바꿉니다.(확장명까지 바꿔주세요)</li>
</ol>
<p><br />
이때는 &lt;head&gt;와 &lt;/head&gt;안에 아래와 같은 내용을 적어 주시면 됩니다...<br />
&lt;link rel=&quot;shortcut icon&quot; href=&quot;http://홈피주소/favicon.ico&quot;&gt;<br />
</p>
<p>&nbsp;</p> 
[이 게시물은 에그당님에 의해 2010-04-08 12:08:22 Html에서 이동 됨]</span>]]></description>
<dc:creator>에그당</dc:creator>
<category>스터디</category>
<category>팁 &amp; 문제해결</category>
<dc:date>Tue, 06 Apr 2010 14:25:08 +0900</dc:date>
</item>
</channel>
</rss>
