1/3 페이지 열람 중
<? $url= "http://www.youtube.com/watch?ist=PL0E8ECDEA23DA6D15&feature=player_detailpage&v=zCSQE5Lwk2s"; preg_match("/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w]*(?:['\"][^<>]*>|<\/a>))[?=…
A YouTube video URL may be encountered in a variety of formats: latest short format:http://youtu.be/NLqAF9hrVbY iframe:http://www.youtube.com/embed/NLqAF9hrVbY iframe (secure):https://www.youtube.com/embed/NLqAF9hrVbY object param:http://www.youtube.com/v/NLqAF9hrVbY?fs=1&hl=en_US object embed:…
본문에서 이미지 추출, 이미지 제거 정규식 preg_match_all('!]*)src=([^\>]*?)\>!is', $write[wr_content], $matches); foreach($matches[0] as $key => $val) { $write[wr_content] = str_replace($val,"",$write[wr_content]); preg_match_all('/([^=^"^ ]*)src=([^ ^>]*)/i', $val, $src_match);…
$str = preg_replace("<\/?(span|font)[^>]*>", "", $str);
$str="Tour site in korea = <![CDATA[ 2 ]]>viewkorea.co.kr<![CDATA[ 3 ]]> Good!"; $str2 = preg_replace('#(?://)?<!\[CDATA\[.+?(?://)?\]\]>#s', '$1', $str); echo "<XMP>$str --></XMP><BR>"; echo "<XMP>$str2";exit; 결과 : Tour si…
<? $url= "http://www.youtube.com/watch?ist=PL0E8ECDEA23DA6D15&feature=player_detailpage&v=zCSQE5Lwk2s"; preg_match("/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w]*(?:['\"][^<>]*>|<\/a>))[?=…
, 로 구별된 숫자 리스트에 포함된지 여부 $lists='111,222,12,33'; $is_notice = preg_match("/[^0-9]{0,1}{$num}[\r]{0,1}/",$lists);
// url에 http:// 를 붙인다 if (!preg_match("/^(http|https|ftp|telnet|news|mms)\:\/\//i", $url)) $url = "http://" . $url; <?php$urls=Array();$urls[]='http://apmusers.com/';$urls[]='https://apmusers.com/';$urls[]='HTTP://APMUSERS.COM/';$urls[]='ahttp://apmusers.com/';//http…
preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/", $date, $m); preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $m);
<? $domain="www.naum.kr"; preg_match('/[^\.]+\.([^\.]{4}|[^\.]{3}|(co|or|pe|ac)\.[^\.]{2}|[^\.]{2})$/i', $domain, $matches); print_r($matches); ?> 결과 : Array ( [0] => naum.kr [1] => kr )