Azzu 2014-09-24 09:46 采纳率: 0%
浏览 1897

Accessing Swift Code IFSC Codes API, Php Script Error

I am trying to access swift codes, ifsc codes, micr codes data from this free API, they have given this sample php code to access the data in JSON format.

unction get_ifsc_code($url, $curl = true) { $responseString = ''; if (!$curl) { /* * if !$curl, use 'file_get_contents' method * to get response string / $responseString = file_get_contents($url); } else { / * if $curl, use 'curl' method * to get response string */

// Initializing curl
$ch = curl_init( $url );

// Configuring curl options
$options = array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array('Content-type: application/json') ,
    //Could be xml
);

// Setting curl options
curl_setopt_array( $ch, $options );

// Getting JSON encoded string
$responseString =  curl_exec($ch);

}
return $responseString;
}
Refer this github code
Sample code from the official site

Please help me in finding the error. I am not getting where it's going wrong.

  • 写回答

1条回答

  • 傲雪星枫 2014-12-18 08:50
    关注

    what is the url?

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!