php purging, echo, html5 sorting
I am having some weird troubles here.. I have this script that will catch
the .mp4 location of a vine video for example..
https://vine.co/v/bv5ZeQjY35 if you check the source of that url you will
see twitter:player:stream set as meta tag.
I already have some code setup to grab and output that result..
function vine_video( $id )
{
$vine = file_get_contents("http://vine.co/v/{$id}");
preg_match('/property="twitter:player:stream" content="(.*?)"/',
$vine, $matches);
return ($matches[1]) ? $matches[1] : false;
}
Right now, the only way to output the content of twitter:player:stream is
to do this,
<?php echo vine_video('bv5ZeQjY35'); ?>
So, The best way I figure this could be setup instead of me just putting
in bv5ZeQjY35 I want it to be outputted from the end of my url by using
this.
$url = $_SERVER['REQUEST_URI'];
$check = end(explode('/v/?',$url));
echo $check;
However, I tried doing this <?php echo vine_video(echo $check); ?> and it
didn't work when I added it into my src=" "
So, I looked up the apache logs and it was saying $check is undefined. But
I was able to output $check on a regular <p></p> tag just fine.
If someone could please help me I would very much appreciate it.
No comments:
Post a Comment