내용에 youtube embed 코드 검사 정규식
$string = '한글dfjasdflajksl'; $pattern = 'src=["']?(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&"'>]+)["']?'; preg_match("/{$pattern}/i", $string, $matches); echo ($matches[0]); //only the src="http://www.youtu.be/dQw4w9WgXcQ part echo ($matches[1]); //the video id part. (dQw4w9WgXcQ) 참고 http://stackoverflow.com/qu..
웹프로그래밍/PHP
2016. 10. 23. 00:29
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Prototype
- Linux
- sencha touch
- 안드로이드
- git
- IOS
- Docker
- Wordpress
- classic asp
- laravel
- iis
- PHP
- API
- 한글
- ASP
- IE
- Debug
- Android
- JQuery
- JSON
- macos
- Mac
- centos
- 워드프레스
- mssql
- iphone
- nodejs
- CSS
- nginx
- javascript
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
글 보관함