我需要帮助将这个$id值放入下面的 javascript
PHP:
<?php
$id = NULL;
$username = 'YouTube';
$xml = simplexml_load_file(sprintf('http://gdata.youtube.com/feeds/base/users/%s/uploads?alt=rss&v=2&orderby=published', $username));
if ( ! empty($xml->channel->item[0]->link) )
{
parse_str(parse_url($xml->channel->item[0]->link, PHP_URL_QUERY), $url_query);
if ( ! empty($url_query['v']) )
$id = $url_query['v'];
}
echo $id; // Outputs the video ID.
?>
JS:需要$id值 ---> '我需要将值放在此处'
<script type="text/javascript">
$('document').ready(function() {
var options = { videoId: 'I need the value to go right here', start: 3 };
$('#video1').tubular(options);
});
</script>