I'd like to know how I can fetch and display only the values from the Google Video URL for a specific value. In this case I have this code below, but everything is not taking the 0B7fH_c8_hjWVY1pQQVc3dGgxOWs
value between /d/
and /preview
.
How can I resolve this so that the result of The value of the item is 0B7fH_c8_hjWVY1pQQVc3dGgxOWs
:
<?php // Retorna um valor na posição 2 pegando o dominio do item como base pra retirar o ID
function buscarID ($urlGeral, $dominio) {
preg_match("/^.*($dominio\/)(\d+)-*/", $urlGeral, $valores);
return $valores[2];
}
echo 'O valor do item e '.buscarID('https://docs.google.com/file/d/0B7fH_c8_hjWVY1pQQVc3dGgxOWs/preview', "docs.google.com"); ?>