Arkadaşlar aşağıdaki kodu php ile nasıl yazabiliriz.
<%
Select Case(gunler)
Case 1
yaziyla_gun="pazar"
Case 2
yaziyla_gun="pazartesi"
Case 3
yaziyla_gun="sali"
Case 4
yaziyla_gun="carsamba"
Case 5
yaziyla_gun="persembe"
Case 6
yaziyla_gun="cuma"
Case 7
yaziyla_gun="cumartesi"
End Select
Function sifirEkle(ByVal strTemp)
strTemp = CInt(strTemp)
If strTemp < 10 Then strTemp = "0"& strTemp
sifirEkle = strTemp
End Function
if yaziyla_gun = "pazartesi" then
tarih = Date()-3
elseif yaziyla_gun = "pazar" then
tarih = Date()-2
else
tarih = Date()-1
end if
strTarih = tarih
Tarih2 = split(strTarih,".")
g=Tarih2(0)
a=Tarih2(1)
y=Tarih2(2)
Public Function VeriAl(strGelen)
Set objVeriAl = Server.CreateObject("Microsoft.XMLHTTP")
objVeriAl.Open "GET" , strGelen, FALSE
objVeriAl.sEnd
VeriAl = objVeriAl.Responsetext
SET objVeriAl = Nothing
End Function
strAdres = "http://www.tcmb.gov.tr/kurlar/"&y&sifirEkle(a)&"/"&sifirEkle(g)&sifirEkle(a)&y&".html"
strVeri = VeriAL(strAdres)
iDolar=InStr(strVeri,"USD" )
strDolarAlis=Mid(strVeri,iDolar+42,6)
Set ConFile=CreateObject("Scripting.FileSystemObject")
Set File=ConFile.CreateTextFile(server.mappath("dosya.txt"), true)
File.WriteLine "&dolar="&strDolarAlis
Set ConFile=Nothing
%>