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

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

개발

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

페이지 정보

profile_image
작성자 관리자 (61.♡.26.29)
댓글 0건 조회 4,064회 작성일 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 392건 16 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
924316004-28
912831004-28
903175004-28
892380004-29
882476004-29
873456004-29
863809004-30
852187004-30
843044004-30
832351005-01
822392005-01
813560005-01
802112005-02
793676005-04
781895005-04
771980005-04
764404005-04
753600005-04
747568005-06
732967005-06

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.