김

최신글 뽑아오기에서 태그 없애기 안됨 ㅠ.ㅠ

김선일씨 끝내 피살 [06-23]

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD class=title height=60><SPAN id… more

이런식으로 나오네요..
태그좀 없애고 싶어요 절대로 안되네요


이것도 안되고

<?
$wr_content = strip_tags($list[$i][content]);
$wr_content = get_text(cut_str($wr_content, 2000, '..........'));

이것도 안됨
<?
$wr_content = cut_str(strip_tags($list[$i][commentcnt], "<style>"),2000,"…");
$wr_content = conv_content($wr_content, 1);
$wr_content = get_text($wr_content);
?>

방법좀 알켜주세요
?>

첨부파일

latest.skin.php (2.5 KB) 1회 2004-06-23 12:07

댓글 3개

저 소스를 대입하면 에러가 나옴 어떻게 하라는 거죠?
다음을 참고하세요.

// HTML 특수문자를 변환
String.prototype.htmlChars = function () {
var str = ((this.replace('"', '&')).replace('"', '"')).replace('\'', ''');
return (str.replace('<', '<')).replace('>', '>');
}

// 좌우 공백없애는 함수
String.prototype.trim = function () { return this.replace(/(^s*)|(s*$)/g, ""); }

// 왼쪽 공백없애는 함수
String.prototype.ltrim = function () { return this.replace(/^s*/g, ""); }

// 오른쪽 공백없애는 함수
String.prototype.rtrim = function () { return this.replace(/s*$/g, ""); }

// 태그만 제거
String.prototype.stripTags = function () {
var str = this;
var pos1 = str.indexOf('<');

if (pos1 == -1) return str;
else {
var pos2 = str.indexOf('>', pos1);
if (pos2 == -1) return str;
return (str.substr(0, pos1) + str.substr(pos2+1)).stripTags();
}
}

// 대소문자 구별하지 않고 단어 위치 찾기
String.prototype.ipos = function (needle, offset) {
var offset = (typeof offset == "number")?offset:0;
var pos1 = str.toLowerCase().indexOf(needle.toLowerCase(), offset);
var pos2 = str.toUpperCase().indexOf(needle.toUpperCase(), offset);

if (pos1 == -1 && pos2 == -1) return false;
if (pos1 == -1) pos1 = str.length + 1;
if (pos2 == -1) pos2 = str.length + 1;

return Math.min(pos1, pos2);
}

// 대소문자 구별하지 않고 뒤에서부터 단어위치 찾기
String.prototype.ripos = function (needle, offset) {
var offset = (typeof offset == "number")?offset:0;
var pos1 = str.toLowerCase().lastIndexOf(needle.toLowerCase(), offset);
var pos2 = str.toUpperCase().lastIndexOf(needle.toUpperCase(), offset);

if (pos1 == -1 && pos2 == -1) return false;
return Math.max(pos1, pos2);
}

// 문자열을 배열로
String.prototype.toArray = function () {
var len = this.length;
var arr = new Array;
for (var i=0; i<len; i++) arr[i] = this.charAt(i);
return arr;
}
댓글을 작성하시려면 로그인이 필요합니다.

그누3질답

9,564건
+
제목 글쓴이 날짜 조회
04-06-23 조회 461
04-06-23 조회 472
04-06-23 조회 562
04-06-23 조회 550
04-06-23 조회 587
04-06-23 조회 636
04-06-22 조회 717
04-06-22 조회 585
04-06-22 조회 530
04-06-22 조회 551
04-06-22 조회 486
04-06-22 조회 500
04-06-22 조회 410
04-06-22 조회 561
04-06-22 조회 866
04-06-22 조회 2,094
04-06-22 조회 572
04-06-21 조회 769
04-06-21 조회 625
04-06-21 조회 422