[CSS] 테이블 줄바꿈 하기
·
Development
테이블에서 특정 문자열의 길이가 길어서 테이블의 모양이 변하거나, 텍스트를 줄바꿈해서 표시하고 싶을 때 아래 코드를 삽입한다. /* 테이블 줄바꿈 스타일 적용 */ table tr td{ overflow: hidden; white-space: initial; text-overflow: ellipsis; -webkit-box-orient: vertical; word-break: break-all; } (설명 추후 추가)
정규표현식 - 특정 HTML 태그 제거하기
·
Development/PHP
해당 태그 및 태그의 내용을 모두 제거한다. #style 태그 제거 $strContents = preg_replace('@
유니코드 변환(decode)
·
Development/PHP
# unicode decode function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8');; } # use $str = utf8_urldecode($str); 참고 : https://www.php.net/manual/en/function.urldecode.php
정규식 html 태그제거
·
Development/PHP
preg_replace() 함수를 이용해서 정규식 치환하기 $strContent = preg_replace("(\]+)\>)", "", $strContent); # 모든 태그 제거 ( 공백으로 치환) $strContents_cp = preg_replace("(\]+)\>)", " ", $strContents_cp); # 치환 후 공백제거(2칸 이상인 공백 한칸으로 변경) $strContents_cp = preg_replace("/\s{2,}/"," ",$strContents_cp);