PHP Döviz Kuru Fonksiyonları

arkadaşlar bu kodlar sitelerde kurları yazan kodlardan alınma ve derlenmedir. ben kodlamadım. sadece kırparak fonksiyona dönüştürdüm. umarum işinize yarar

1. kod (tercihimdir)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//www.soulsmasher.net
function dolaralis() {
$dolar = "USD/TRY";
$dosya=file("http://www.tcmb.gov.tr/kurlar/today.html");
for ($i=0; $i<sizeof($dosya); $i++)	{
if(ereg($dolar, $dosya[$i])) {
$alanlar = split("[[:space:]]+" , $dosya[$i]);
return $alanlar[4];
		}
	}
}
 
function dolarsatis() {
$dolar = "USD/TRY";
$dosya=file("http://www.tcmb.gov.tr/kurlar/today.html");
for ($i=0; $i<sizeof($dosya); $i++) {
if(ereg($dolar, $dosya[$i])) {
$alanlar = split("[[:space:]]+" , $dosya[$i]);
return $alanlar[5];
		}
	}
}
 
 
function euroalis() {
$euro = "EUR/TRY";
$dosya=file("http://www.tcmb.gov.tr/kurlar/today.html");
for ($i=0; $i<sizeof($dosya); $i++) {
if(ereg($euro, $dosya[$i])) {
$alanlar = split("[[:space:]]+" , $dosya[$i]);
return $alanlar[3];
		}
	}
}
 
function eurosatis() {
$euro = "EUR/TRY";
$dosya=file("http://www.tcmb.gov.tr/kurlar/today.html");
for ($i=0; $i<sizeof($dosya); $i++) {
if(ereg($euro, $dosya[$i])) {
$alanlar = split("[[:space:]]+" , $dosya[$i]);
return $alanlar[4];
		}
	}
}
 
//returnler yerine echo yazarsanız fonksiyonda fonksiyon çağırırken echo yazmana da gerek kalmaz unutma değişkeni fonksiyon yapabilicek olursan
echo dolaralis();
//dolarsatis vs
?>

afiyet olsun ;)

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

0 Responses to “PHP Döviz Kuru Fonksiyonları”


  1. No Comments

Leave a Reply

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a