Php
I am trying to access swift codes, IFSC codes, MICR codes data from this free API, they has 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 ' me Thod * 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 optionscurl_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.