I'm trying to create an replacement which remove everything what is not between "http://" and ".flv".
Here is my code:
preg_replace('"http://(.*?).f;v"', '', $code);
but it doesn't work. Anyone can help me?
Thanks.
I'm trying to create an replacement which remove everything what is not between "http://" and ".flv".
Here is my code:
preg_replace('"http://(.*?).f;v"', '', $code);
but it doesn't work. Anyone can help me?
Thanks.
remove everything what is not between "http://" and ".flv"
http://example.com/path/test.flv?param=1 --> example.com/path/test
BTW, you have a typo in f;v
, and your delimiters may cause problems. Replace
preg_replace('"http://(.*?).f;v"', '', $code);
with
preg_replace('/http\:\/\/(.*?)\.flv.*/i', '$1', $code);
Are you looking for something like this:
http:\/\/(.*?).flv
http://www.somesite.com/ac.flv