Relative Content

Tag Archive for phpregex

PHP regex find video or audio all occurences [duplicate]

This question already has answers here: Find <video> tag with specific style declarations then return the src value of its child <source> tag (6 answers) RegEx match open tags except XHTML self-contained tags (36 answers) Closed 2 days ago. I have this regex: $str = ‘<video controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/08/lip_mask.mp4″></video><video controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/06/09.mp4″></video><audio controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/07/01.mp3″></audio>’; preg_match_all(‘/<video[^>]+src=”([^”]+)”)/’, $str, $matches); […]

PHP regex find video or audio all occurences [duplicate]

This question already has answers here: Find <video> tag with specific style declarations then return the src value of its child <source> tag (6 answers) RegEx match open tags except XHTML self-contained tags (36 answers) Closed 2 days ago. I have this regex: $str = ‘<video controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/08/lip_mask.mp4″></video><video controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/06/09.mp4″></video><audio controls src=”http://localhost/xampp/wp/wp-content/uploads/2024/07/01.mp3″></audio>’; preg_match_all(‘/<video[^>]+src=”([^”]+)”)/’, $str, $matches); […]