구매고객
판매자
솔루션별 질문
<?php echo cut_str(strip_tags($list[$i]['subject']), 34,'…'); ?>
cut_str로 제목글자 자르기함수를 써놨는데 여기에 추가적으로 특수문자들은 안나오게 처리하려고합니다
!!!!!!!!!!!!!!!!!!!!!!
https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=299307
<?php $business_title = $list[$i]['subject']; $business_title = str_replace(array("!","@","#","$","※"), "", $business_title); ?> <?php echo cut_str(strip_tags($business_title), 34,'…'); ?>
이렇게 처리하니 잘되네요 대신 array 노가다를 좀..
function processText($text) { $text = strip_tags($text); $text = trim($text); $text = htmlspecialchars($text); return $text;}
윗분 답변과 더불어 이걸 쓰시면 좋겠네요
답변을 작성하려면 로그인이 필요합니다.
광고가 아닌 글을 신고하면 회원님의 신고 권한이 제한될 수 있습니다. 신중하게 신고해 주세요.