我刚刚使用file_get_contents来检索我网站上的数据.但它不会返回任何东西.
file_get_contents("https://www.google.co.in/images/srpr/logo11w.png")
Run Code Online (Sandbox Code Playgroud)
当我在我的本地环境中使用它时,它返回值.
我也尝试在我的网站上卷曲,以确定它是否返回任何东西.但它表明
禁止
您无权访问.
我用Google搜索,我发现了一些提示.我启用了allow_url_fopen和allow_url_include.
但没有任何效果.
我试过的卷曲代码
function curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$return = curl_exec($ch); curl_close ($ch);
return $return;
}
$string = curl('https://www.google.co.in/images/srpr/logo11w.png');
echo $string;
Run Code Online (Sandbox Code Playgroud) 我需要使用我拥有的货币代码来获取国家/地区名称.
有可能吗?
我正在努力从url中恢复制造商属性
本地主机/ magento的/ index.php的/测试pro.html?制造商/ 4
所以我用过 $this->getRequest()->getParam('manufacturer')
我没有得到任何输出.
但是当我将url更改为localhost/magento/index.php/test-pro.html?manufacturer = 4
(/替换为=)时,我得到了正确的输出.
但我需要url应该是localhost/magento/index.php/test-pro.html?manufacturer/4
并希望获取与该制造商ID相关的产品4.
来人帮帮我.
我想在magento的管理面板中使用自定义模块创建动态字段.
它必须类似于产品部分下的自定义选项.
有人给我一个主意.