태그 갯수를 알아보는 페이지 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

태그 갯수를 알아보는 페이지 정보

태그 갯수를 알아보는 페이지

본문

파일명 : tablecheck.php


<?
@extract($_GET);

if (!$url) {
    echo "?url= 값을 넘겨주세요.";
    exit;
}

$s = implode(" ", file($url, "r"));
$s = strtolower($s);
$table1 = substr_count($s, "<table");
$table2 = substr_count($s, "</table");
$tr1 = substr_count($s, "<tr");
$tr2 = substr_count($s, "</tr");
$td1 = substr_count($s, "<td");
$td2 = substr_count($s, "</td");
$form1 = substr_count($s, "<form");
$form2 = substr_count($s, "</form");
$a1 = substr_count($s, "<a ");
$a2 = substr_count($s, "</a");

echo "<br>&lt;table&gt;  &nbsp;: ".$table1;
echo "<br>&lt;/table&gt; : ".$table2;
echo "<br>&lt;tr&gt;  &nbsp;: ".$tr1;
echo "<br>&lt;/tr&gt; : ".$tr2;
echo "<br>&lt;td&gt;  &nbsp;: ".$td1;
echo "<br>&lt;/td&gt; : ".$td2;
echo "<br>&lt;form&gt;  &nbsp;: ".$form1;
echo "<br>&lt;/form&gt; : ".$form2;
echo "<br>&lt;a&gt;  &nbsp;: ".$a1;
echo "<br>&lt;/a&gt; : ".$a2;
?>



사용법 : http://도메인/tablecheck.php?url=http://주소

결과 :

<table>  : 33
</table> : 33
<tr>  : 70
</tr> : 69
<td>  : 98
</td> : 97
<form>  : 2
</form> : 2
<a>  : 20
</a> : 20

* 테이블과 관련된 태그 갯수를 알아보고자 하는 경우 유용합니다.
추천
2

댓글 3개

멋진 팁이군요. 감사합니다 ^^

덤으로 화면에서 링크 받아서 확인해볼수있는 링크가 그누보드에도 하나 있으면 좋겠군요. ^^
감사합니다.
div, span까지 끼워넣어서 해보란 말씀이시죠?!
엇~!! 짝이 안맞는 녀석도 보이네요.^^

ps)서버에서 파일함수를 막아놓은 것인가요??
Warning: file(): URL file-access is disabled in the server configuration in ~~tablecheck.php on line 9

ps2)돌아가는 방법을 찾았습니다.^^

ps3)소켓으로..  http://www.sir.co.kr/bbs/tb.php/g4_tiptech/7452
전체 3,309 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT