내용에 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
- Docker
- 안드로이드
- JQuery
- git
- 워드프레스
- Prototype
- Android
- nodejs
- IOS
- javascript
- API
- 한글
- PHP
- mssql
- Wordpress
- ASP
- CSS
- macos
- JSON
- laravel
- IE
- Debug
- Linux
- nginx
- centos
- iis
- iphone
- sencha touch
- Mac
- classic asp
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 |
| 30 | 31 |
글 보관함