페이지파싱을 배우는데..

· 2011-06-22 (수) 11:13:49 · 1137 · 2
"�׷� �Խ��� ���� �ۼ��� "

아래 소스를 그대로 적용했는데... 화면에 보여지는건 위처럼 나오네요...~

유창화님의 소스인데.. 그대로 해도 전 안되네요...

어느부분이 잘못된걸까요?


<?php

$url = 'http://sir.co.kr/bbs/new.php';
$text = file_get_contents($url);

$temp = @explode('<colgroup width="60">', $text);
$temp = @explode('</form>', $temp[1]);

$text = $temp[0];

preg_match_all("`<tr align='center' height='30'><td align='left'>.*<a href='new\.php\?gr_id=.+'>(.+)</a>.*</td><td align='left'>.*<a href='new\.php\?bo_table=.+'>(.+)</a>.*</td><td.*<a href='board\.php\?.+&wr_id=.+'>(.+)</a>.*</td><td>.*<a href=\"javascript:;\" onClick=\"showSideView\(.+\);\".+>(.+)</a>.*</td>.*</tr>`iU", $text, $match);

if (is_array($match[1])){

$text = '<table><tr><td>그룹</td><td>게시판</td><td>제목</td><td>작성자</td></tr>';
foreach($match[1] as $k => $v){

$text .= '<tr><td>' . $v . '</td><td>' . $match[2][$k] . '</td><td>' . $match[3][$k] . '</td><td>' . str_replace("../", 'http://sir.co.kr/', $match[4][$k]) . '</td></tr>';
}
$text .= '</table>';
}

echo $text;

?>
|

댓글 2개

언어셋 지정하세요.
맨위에 아래내용을 추가했는데..이렇게 하면 언어셋 지정하는것 맞는건가요?

<meta http-equiv="content-type" content="text/html; charset=euc-kr">
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
11-06-22 조회 2,049
11-06-22 조회 1,241
11-06-22 조회 831
11-06-22 조회 927
11-06-22 조회 827
11-06-22 조회 1,044
11-06-22 조회 1,785
11-06-22 조회 1,026
11-06-22 조회 963
11-06-22 조회 951
11-06-22 조회 1,053
11-06-22 조회 848
11-06-22 조회 770
11-06-22 조회 803
11-06-22 조회 1,138
11-06-22 조회 1,031
11-06-22 조회 854
11-06-22 조회 1,137
11-06-22 조회 2,973
11-06-22 조회 1,332