【发布时间】:2015-01-13 19:12:43
【问题描述】:
你好,我试图为不同的函数定义一个全局变量,但我不断得到 无法打开流,我就是找不到问题所在。 你能帮我找出我做错了什么吗?
谢谢!
<?php
$feedURL = "http://gdata.youtube.com/feeds/api/users/ArrolladoraLimonVEVO?alt=json";
function GetytTitle() {
global $feedURL;
$json = file_get_contents ('feedURL');
$obj = json_decode($json,true);
return $obj['entry']['title']['$t'];
}
?>
【问题讨论】:
标签: php variables global-variables