Last active
November 7, 2018 10:31
-
-
Save barisesen/1f003721e40a7b0808445b6c7701b28a to your computer and use it in GitHub Desktop.
Tcmb günlük kurlar php http://www.tcmb.gov.tr/kurlar/today.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// bloomberght anlık | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com'); | |
curl_setopt($ch, CURLOPT_URL, "http://www.bloomberght.com/doviz/dolar/"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$site = curl_exec($ch); | |
curl_close($ch); | |
$re = '/<span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 piyasaDataValues">[\n]*\s+<span>SATIŞ.*<b>(.*?)<\/b>/mi'; | |
preg_match($re, $site, $matches); | |
echo($matches[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// finansbank anlık | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com'); | |
curl_setopt($ch, CURLOPT_URL, "https://www.qnbfinansbank.com/doviz-kur-bilgileri/"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$site = curl_exec($ch); | |
curl_close($ch); | |
preg_match_all('@<td class="tutarNoTl right">(.*?)</td>@si',$site,$veri); | |
echo $veri[1][1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// tcmb günlük | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com'); | |
curl_setopt($ch, CURLOPT_URL, "http://www.tcmb.gov.tr/kurlar/today.xml"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$site = curl_exec($ch); | |
curl_close($ch); | |
$site = simplexml_load_string($site); | |
$selling = $site->Currency[0]->ForexSelling[0]; | |
echo $selling; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment