Jump to content

[SOLVED] preg match. get part of link PLEASE HELP!


jwk811

Recommended Posts

<?php

$url="http://www.youtube.com/watch?v=gUPduAbJpsU&videos=HsyjHLxVbwo&playnext_from=TL&playnext=1";

preg_match("/[v]\=[a-zA-Z]{0,20}/",$url,$match);

$result=implode(' ',$match);

echo $result;
?>

 

that gets me this: gUPduAbJpsU

BUT theres a problem. if there is a number in that part it will stop at the number and only give me part of what i need.

 

what if i wanna get the video id from a link like this:

 

 

PLEASE HELP!!!

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.