Hi, can you please help to transform this: <span style="display:none;" allowFullScreen="true" src="http://server.com/video.mp4" width="400" height="350"></span><br/>Â <br/>Â <br/><div align="center"><span style="display:none;" allowFullScreen="true" src="http://server.com/video.mp4" width="400" height="350"></span> PHP: into this: <video width="320" height="240" controls="controls"> <source src="http://server.com/video.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> PHP: I want to use preg_match replace and use the video url but I need help setting regular expression... Thanks.
Try this: $html = '<span style="display:none;" allowFullScreen="true" src="http://server.com/video.mp4" width="400" height="350"></span><br/>A <br/>A <br/><div align="center"><span style="display:none;" allowFullScreen="true" src="http://server.com/video.mp4" width="400" height="350"></span>'; preg_match('#<span style="display:none;" allowFullScreen="true" src="(.*?)"#', $html, $out); echo '<video width="320" height="240" controls="controls"> <source src="'.$out[1].'" type="video/mp4" /> Your browser does not support the video tag. </video>'; PHP: