페이지파싱을 배우는데.. 정보
페이지파싱을 배우는데..본문
"�� �Խ��� ���� �ۼ��� "
아래 소스를 그대로 적용했는데... 화면에 보여지는건 위처럼 나오네요...~
유창화님의 소스인데.. 그대로 해도 전 안되네요...
어느부분이 잘못된걸까요?
<?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;
?>
아래 소스를 그대로 적용했는데... 화면에 보여지는건 위처럼 나오네요...~
유창화님의 소스인데.. 그대로 해도 전 안되네요...
어느부분이 잘못된걸까요?
<?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;
?>
댓글 전체

언어셋 지정하세요.
맨위에 아래내용을 추가했는데..이렇게 하면 언어셋 지정하는것 맞는건가요?
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<meta http-equiv="content-type" content="text/html; charset=euc-kr">