preg_replace 로 게시물 스타일시트를 제거 하려고 합니다.
아래와 같이 처리 하면 잘 처리 되어는데요.
$content = preg_replace("!<style(.*?)<\/style>!is", '', $content);
아래의 스타일 처럼 들어가면 적용이 안되네요
답변 부탁 합니다.
== 문제의 스타일 ======================================
<STYLE> body {background-image:url(http://blogfiles7.naver.net/data17/2006/7/4/102/5_1147903815-coco767.gif); background-attachment: fixed; background-repeat: repeat; background-position: bottom right;} table { background-color: transparent
; } td { background-color: transparent; }<STYLE>
=====================================================<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 18:00:23 Regular Expression (정규표현식)에서 이동 됨]</div>
아래와 같이 처리 하면 잘 처리 되어는데요.
$content = preg_replace("!<style(.*?)<\/style>!is", '', $content);
아래의 스타일 처럼 들어가면 적용이 안되네요
답변 부탁 합니다.
== 문제의 스타일 ======================================
<STYLE> body {background-image:url(http://blogfiles7.naver.net/data17/2006/7/4/102/5_1147903815-coco767.gif); background-attachment: fixed; background-repeat: repeat; background-position: bottom right;} table { background-color: transparent
; } td { background-color: transparent; }<STYLE>
=====================================================<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 18:00:23 Regular Expression (정규표현식)에서 이동 됨]</div>
댓글 1개
15년 전
$content = preg_replace("/<style[^<]*</is", "", $content);
이런 코드가 아닐까요?
$content = preg_replace("/<style[^<]*</is", "", $content);
이런 코드가 아닐까요?
이런 코드가 아닐까요?
$content = preg_replace("/<style[^<]*</is", "", $content);
이런 코드가 아닐까요?
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 394 | ||
| 7929 | 9년 전 | 303 | ||
| 7928 | 9년 전 | 402 | ||
| 7927 | 9년 전 | 321 | ||
| 7926 | 9년 전 | 652 | ||
| 7925 | 9년 전 | 338 | ||
| 7924 | 9년 전 | 321 | ||
| 7923 | 9년 전 | 332 | ||
| 7922 | 9년 전 | 352 | ||
| 7921 | 9년 전 | 392 | ||
| 7920 | 9년 전 | 308 | ||
| 7919 | 9년 전 | 327 | ||
| 7918 | 9년 전 | 481 | ||
| 7917 | 9년 전 | 323 | ||
| 7916 | 9년 전 | 394 | ||
| 7915 | 9년 전 | 392 | ||
| 7914 | 9년 전 | 397 | ||
| 7913 | 9년 전 | 547 | ||
| 7912 | 9년 전 | 398 | ||
| 7911 | 9년 전 | 351 | ||
| 7910 | 9년 전 | 389 | ||
| 7909 | 9년 전 | 491 | ||
| 7908 | 9년 전 | 405 | ||
| 7907 | 9년 전 | 348 | ||
| 7906 | 9년 전 | 368 | ||
| 7905 | 9년 전 | 351 | ||
| 7904 | 9년 전 | 336 | ||
| 7903 | 9년 전 | 333 | ||
| 7902 | 9년 전 | 540 | ||
| 7901 |
|
9년 전 | 723 | |
| 7900 | 9년 전 | 558 | ||
| 7899 | 9년 전 | 362 | ||
| 7898 | 9년 전 | 368 | ||
| 7897 | 9년 전 | 325 | ||
| 7896 | 9년 전 | 345 | ||
| 7895 | 9년 전 | 451 | ||
| 7894 | 9년 전 | 368 | ||
| 7893 | 9년 전 | 314 | ||
| 7892 | 9년 전 | 362 | ||
| 7891 | 9년 전 | 746 | ||
| 7890 | 9년 전 | 1184 | ||
| 7889 | 9년 전 | 739 | ||
| 7888 |
limsy1987
|
9년 전 | 534 | |
| 7887 | 9년 전 | 526 | ||
| 7886 | 9년 전 | 417 | ||
| 7885 | 9년 전 | 386 | ||
| 7884 | 9년 전 | 392 | ||
| 7883 | 9년 전 | 383 | ||
| 7882 | 9년 전 | 417 | ||
| 7881 | 9년 전 | 423 | ||
| 7880 | 9년 전 | 545 | ||
| 7879 | 9년 전 | 442 | ||
| 7878 | 9년 전 | 1194 | ||
| 7877 | 9년 전 | 731 | ||
| 7876 | 9년 전 | 466 | ||
| 7875 | 9년 전 | 540 | ||
| 7874 |
|
9년 전 | 796 | |
| 7873 | 9년 전 | 503 | ||
| 7872 | 9년 전 | 656 | ||
| 7871 | 9년 전 | 465 | ||
| 7870 | 9년 전 | 595 | ||
| 7869 | 9년 전 | 413 | ||
| 7868 | 9년 전 | 421 | ||
| 7867 | 9년 전 | 402 | ||
| 7866 | 9년 전 | 471 | ||
| 7865 | 9년 전 | 428 | ||
| 7864 | 9년 전 | 497 | ||
| 7863 | 9년 전 | 495 | ||
| 7862 | 9년 전 | 453 | ||
| 7861 | 9년 전 | 612 | ||
| 7860 | 9년 전 | 606 | ||
| 7859 | 9년 전 | 392 | ||
| 7858 | 9년 전 | 688 | ||
| 7857 | 9년 전 | 1052 | ||
| 7856 | 9년 전 | 498 | ||
| 7855 | 9년 전 | 727 | ||
| 7854 | 9년 전 | 713 | ||
| 7853 | 9년 전 | 568 | ||
| 7852 | 9년 전 | 492 | ||
| 7851 | 9년 전 | 485 | ||
| 7850 | 9년 전 | 572 | ||
| 7849 | 9년 전 | 343 | ||
| 7848 | 9년 전 | 395 | ||
| 7847 | 9년 전 | 629 | ||
| 7846 | 9년 전 | 439 | ||
| 7845 | 9년 전 | 394 | ||
| 7844 | 9년 전 | 379 | ||
| 7843 | 9년 전 | 397 | ||
| 7842 | 9년 전 | 382 | ||
| 7841 | 9년 전 | 369 | ||
| 7840 | 9년 전 | 382 | ||
| 7839 | 9년 전 | 420 | ||
| 7838 | 9년 전 | 501 | ||
| 7837 | 9년 전 | 340 | ||
| 7836 | 9년 전 | 380 | ||
| 7835 | 9년 전 | 456 | ||
| 7834 |
|
9년 전 | 1182 | |
| 7833 | 9년 전 | 401 | ||
| 7832 | 9년 전 | 396 | ||
| 7831 | 9년 전 | 537 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기