1
I would like to know how to search and make appear only the values of the URL of Google video, seeking a specific value. In this case I have this code below, with everything not getting the value 0B7fH_c8_hjWVY1pQQVc3dGgxOWs
between the /d/
and the /preview
.
How can I resolve this so that the result of The item value 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"); ?>