Jump to content

Preg_Match


chasethemetal

Recommended Posts

Hey everyone! I have a script someone on the forum helped me with awhile back that takes the contents of src="" from an embedded video. It works fine with I run this script in a while loop. But I am trying to get the match to work on the fly with $_POST method instead now, and it's not working. Here's the code... and I'm confused as to why it doesnt work by getting the content from a $_POST but gets it when its pulling it from a database in a while loop. the working script while($info = mysql_fetch_array( $data )) {$pattern[1] = '/src="([^"]+)"/i';preg_match($pattern[1], $info['file'], $match);echo $match[1];} $info['file'] is video embed info like...<iframe src="http://player.vimeo.com/video/00000000?title=0&byline=0&portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe> and $match[1] will return me "http://player.vimeo.com/video/00000000?title=0&byline=0&portrait=0" BUT now I want it to work like this, but it doesn't seem to work... $pattern[1] = '/src="([^"]+)"/i';preg_match($pattern[1], $_POST['file'], $match);echo $match[1]; Thanks any help would be AWESOME!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...