所以我有这个url http://my-server.com/feeds/feed.pl?op=retrieveIncidents&type=social,government&cbsa=31100包含由另一个进程构建的xml数据。现在我使用file_get_contents()
和硬编码的网址,它工作得很好。在dev的这个阶段,我不得不开始使用配置文件和登录应用程序的当前用户的cbsa代码。
现在这个/feeds/feed.pl?op=retrieveIncidents&type=social,government&cbsa=
来自配置。
此31100
来自用户对象。
这个http://my-server.com
来自帮助者fn()。
$server = $this->serverUrl();
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/application.ini', APPLICATION_ENV);
$curOperator = Default_Model_Operator::getActiveOperator();
$feedUrl = $server.$config->ims->idfFeed.$curOperator->regions;
如果我打印/ echo $feedUrl
看起来像http://my-server.com/feeds/feed.pl?op=retrieveIncidents&type=social,government&cbsa=31100
但是当我做$feed = file_get_contents($feedUrl)
时,我得到了
警告:file_get_contents(http://vdot.orion.meridian-enviro.com/feeds/feed.pl?op=retrieveIncidents &
type = social,government &
cbsa = 31100)[function.file-get-contents]:无法打开流: HTTP请求失败!找不到HTTP / 1.1 404
在 /home/Agena/lvegerano/svn/webapps/ims/trunk/phpfiles/application/views/scripts/chp/list-for-dashboard.phtml 的 9 行
记下&
。我尝试了htmlentities_decode()
,urlencode()
和其他人,并且无法将其付诸实践。我该怎么办file_get_contents()将&
翻译成&
?
如何解决这个问题的任何帮助将不胜感激。
答案 0 :(得分:0)
我想我忘了回答这个问题。问题是我们的清漆设置。设置为查找URL,如果识别则插入主机名。因为我刚开始在这里工作,所以我不知道这个功能。因此错误我认为不是因为清漆掩盖了网址。