문자열에서 주석구문을 제거하는 PHP 정규식 > 개발

본문 바로가기
사이트 내 전체검색

개발

문자열에서 주석구문을 제거하는 PHP 정규식

페이지 정보

profile_image
작성자 관리자 (61.♡.26.29)
댓글 0건 조회 4,080회 작성일 17-06-13 23:16

본문

/* */주석
[code]
<?php
$str = preg_replace('/\/\*(.*?)\*\//is', '', $str);
?>
[/code]

<!-- -->주석
[code]
<?php
$str = preg_replace('/<!--(.*?)-->/is', '', $str);
?>
[/code]
 
//주석
[code]
<?php
$str = preg_replace('/\/\/(.*)\n', '', $str);
?>
[/code]
 
#주석
[code]
<?php
$str = preg_replace('/#(.*)\n/', '', $str);
?>
[/code]
 
'주석
[code]
<?php
$str = preg_replace('/'(.*)\n/', '', $str);
?>
[/code]


* 출처 : http://openlife.tistory.com/378

추천0

댓글목록

등록된 댓글이 없습니다.

Total 393건 7 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
2732950009-07
2722237009-06
2712480006-30
2702820006-30
2693194006-29
2683802006-29
2672447006-22
2663089006-22
2652931006-16
2643079006-14
2634861006-10
2622015006-07
2611901005-30
2602090005-30
2594191005-28
2582521005-28
2572014005-16
2565426005-10
2552671005-07
2544061004-07

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.