// klasör varmı yokmu kontrol **************************************************************************************************** : Notes">

NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io


<?php

$klasor_adi = "deneme";

if(file_exists($klasor_adi))
{
echo "Klasör var.";
}
else
{
echo "Klasör yok.";
}

?>

// klasör varmı yokmu kontrol

******************************************************************************************************************************************************************

<?php

$dosya_adi = "index.php";

if(file_exists($dosya_adi))
{
echo "Dosya var.";
}
else
{
echo "Dosya yok.";
}

?>

// dosya varmı yokmu kontrol
******************************************************************************************************************************************************************

<?php

$dosya_veya_klasor_adi = "test";

if(is_file($dosya_veya_klasor_adi))
{
echo "Bu bir dosyadır!";
}

if(is_dir($dosya_veya_klasor_adi))
{
echo "Bu bir klasördür!";
}

?>

// bir klasörmü bir dosyamı

******************************************************************************************************************************************************************



<?php

$klasor_adi = "dosya";

if(file_exists($klasor_adi))
{
echo "Klasör zaten var!";
exit();//İşlemi durdur
}

$olustur = mkdir("$klasor_adi");

if($olustur)
{
echo "Klasör oluşturuldu.";
}
else
{
echo "Klasör oluşturulamadı!";
}

?>

// klasör oluşturma varmı yokmu kontrol


******************************************************************************************************************************************************************

<?php

$klasor_adi = "test";

if(!file_exists($klasor_adi))
{
echo "Silinecek klasör yok!";
exit();//İşlemi durdur
}

$klasor_sil = rmdir($klasor_adi);

if($klasor_sil)
{

echo "Klasör silindi.";

}
else
{

echo "Klasör silinemedi!";

}

?>


// klasör silme

******************************************************************************************************************************************************************


<?php

$dosya_adi="dosya.txt";

if (file_exists($dosya_adi))
{
echo "Dosya zaten var!";
}
else

{
touch($dosya_adi);
echo "Dosya oluşturuldu.";
}

?>


// dosya oluşturma (x.txt vb.)

******************************************************************************************************************************************************************



<?php

$dosya = "dosya.txt";

$dosya=fopen($dosya,"a");

$veri_yazdir="deneme123 ";

fwrite($dosya, $veri_yazdir);

echo "veri yazdırıldı.";

fclose($dosya);

?>

// dosya aç dosyaya yazdır.


******************************************************************************************************************************************************************


<?php
$dosya = fopen("dosya.txt","r");

if(!($dosya))
{
echo "dosya.txt bulunamadı.";
exit();
}

while(!feof($dosya))
{
$satir = fgets($dosya, 255);
echo("$satir");
}

fclose($dosya);
?>

// dosyayı aç dosyayı oku dosyayı ekrana yazdır.

******************************************************************************************************************************************************************



<?php

$dosya_adi="dosya.txt";

if(!file_exists($dosya_adi))
{
echo "Silinecek dosya yok!";
exit();//İşlemi durdur
}

unlink($dosya_adi);
echo "Dosya silindi.";

?>


// dosya silme

******************************************************************************************************************************************************************

<?
$dir = "c:/deneme/";
if ($dosya = (fopen ("$dir/dosya.txt" , 'r') ) ) {
echo "Dosya Açıldı";
}
else {
echo "Dosya Açılmadı.";
}
while ( ! feof ($dosya ) ) {
$satir = fgets ( $dosya, 1024 ) ;
echo ("$satir");
}
fclose ($dosya);
?>
******************************************************************************************************************************************************************


<?
$dosya = fopen("dosya.txt" , 'a') or die ("Dosya açılamıyor!") ;
?>

******************************************************************************************************************************************************************

$_fILES --> ile koyduğumuz dosya nesnesinden seçileni çekiyoruz
$kaynak =$_FILES["dosya"]["tmp_name"];
$hedef=$_FILES["dosya"]["name"];
copy($kaynak,$hedef);
echo "<img src=".$hedef."/>";

// KOPYALAMA İŞLEMİ

******************************************************************************************************************************************************************

<?php
$random=rand(1,10);
$ac=fopen("metin.txt","w");
fwrite($ac,$random);
fclose($ac);


$dosya=fopen("metin.txt","r");
while(!feof($dosya))
{if($random<$ac)
echo "girilen sayı daha büyük";
else if($ac<$random)
echo "random değeri daha büyük";
else
echo "sayılar biribirine eşittir";

$oku=fgets($dosya);


}
echo $random;

fclose($dosya);
?>

// random ile metine değer atarak karşılaştırma.


******************************************************************************************************************************************************************

$dosya = fopen("dosya.txt","r");

if(!($dosya))
{
exit();
}

while(!feof($dosya))
{

$satir = fgets($dosya);
echo("$satir <br>");

if($satir == $a)
echo"sayıyı doğru tahmin ettiniz.";
else
echo"tahmininiz yanlış.";
}

fclose($dosya);

//sayı tahmini kodlar


******************************************************************************************************************************************************************

<?php
/*5 basamaklı bir sayının basamak çözümlemesin yapan program*/
$sayi=12345;

$birler = $sayi % 10;
$sayi = $sayi / 10;

$onlar = $sayi % 10;
$sayi = $sayi / 10;

$yuzler = $sayi % 10;
$sayi = $sayi / 10;

$binler = $sayi % 10;
$sayi = $sayi / 10;

$onbinler = $sayi %10;
$sayi=$sayi/10;

echo "birler :".$birler."<br>";
echo "onlar :".$onlar."<br>";
echo "yuzler :".$yuzler."<br>";
echo "binler :".$binler."<br>";
echo "onbinler :".$onbinler."<br>";

echo "<font color=red>osman karadeniz</font>";
?>

// basamak çözümleme mod1

******************************************************************************************************************************************************************

<?php
/* basamak çözümleme farklı teknik ile (umut pc) */
error_reporting(0);
$sayi=12345;
$basamak= array();
for($i=0;$i<=4;$i++)
{
$mod=$sayi%10;
$sayi=$sayi-$mod;
$sayi=$sayi/10;
$basamak[$i]=$mod;
}

echo "birler basamagı :".$basamak[0]."<br>";
echo "onlar basmagı :" .$basamak[1]."<br>";
echo "yüzler basmagı :" .$basamak[2]."<br>";
echo "binler basmagı :" .$basamak[3]."<br>";
echo "onbinler basmagı :" .$basamak[4]."<br>";

?>

// basamak çözümleme mod2

******************************************************************************************************************************************************************

/* 1 dan 10 A kadar olan çarpım tablosu */
error_reporting(0);
echo "<table border=1 style=border-color:blue>";

for($s=1;$s<=10;$s++)
{
for($g=1;$g<=10;$g++)
{echo "<td>".$s."*".$g.": "."<font color=red>".($s*$g)."</font></td>";}
echo "</tr>";
}

echo "</table>";

************************************************************************************************************************************************************************************************************************************************************************************************************
<?php
$ders1not1=15;
$ders1not2=25;
$ders1perf1=59;
$ders1perf2=60;

$ders2not1=24;
$ders2not2=23;
$ders2perf1=58;
$ders2perf2=62;

$ders3not1=11;
$ders3not2=33;
$ders3perf1=53;
$ders3perf2=60;

$ders4not1=13;
$ders4not2=25;
$ders4perf1=49;
$ders4perf2=60;


$dersler1="internet programcılığı";
$dersler2="grafik ve tasarım";
$dersler3="Gelişmiş.İ.U";
$dersler4="AKİS";
echo "<table border=1 style=text-align:center;> ";
echo "<tr>";
for($i=1;$i<=5;$i++)
{


for($y=1;$y<=6;$y++)
{

if($y==1)
{
echo "<td> dersler </td>";
echo "<td>Sınav 1</td>";
echo "<td>Sınav 2</td>";
echo "<td>Performans 1</td>";
echo "<td>Performans 2</td>";
echo "<td> <font color=red>ortalama </font> </td>";
echo "</tr>";

}


if($y==2)
{
$ortalama1=($ders1not1+$ders1not2+$ders1perf1+$ders1perf2)/4;
echo "<td>".$dersler1."</td>";
echo "<td>".$ders1not1."</td>";
echo "<td>".$ders1not2."</td>";
echo "<td>".$ders1perf1."</td>";
echo "<td>".$ders1perf2."</td>";
echo "<td> <font color=red>ortalama".$ortalama1."</font> </td>";
echo "</tr>";

}


if($y==3)
{
$ortalama2=($ders2not1+$ders2not2+$ders2perf1+$ders2perf2)/4;
echo "<td>".$dersler2.".</td>";
echo "<td>".$ders2not1."</td>";
echo "<td>".$ders2not2."</td>";
echo "<td>".$ders2perf1."</td>";
echo "<td>".$ders2perf2."</td>";
echo "<td> <font color=red>ortalama".$ortalama2."</font> </td>";
echo "</tr>";

}

if($y==4)
{
$ortalama3=($ders3not1+$ders3not2+$ders3perf1+$ders3perf2)/4;
echo "<td>".$dersler3.".</td>";
echo "<td>".$ders3not1."</td>";
echo "<td>".$ders3not2."</td>";
echo "<td>".$ders3perf1."</td>";
echo "<td>".$ders3perf2."</td>";
echo "<td> <font color=red>ortalama".$ortalama3."</font> </td>";
echo "</tr>";

}

if($y==5)
{
$ortalama4=($ders4not1+$ders4not2+$ders4perf1+$ders4perf2)/4;
echo "<td>".$dersler4.".</td>";
echo "<td>".$ders4not1."</td>";
echo "<td>".$ders4not2."</td>";
echo "<td>".$ders4perf1."</td>";
echo "<td>".$ders4perf2."</td>";
echo "<td> <font color=red>ortalama".$ortalama4."</font> </td>";
echo "</tr>";
echo "<p style=text-align:center;color:red;>osman karadeniz</p>";
exit;
}


}



}

echo "</table>";
?>


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

$toplam=0;
for($i=0;$i<=100;$i++)
{if($i%2==1) // çift sayılar için "0" tek sayılar için "1";
{$toplam=$toplam+$i;}
}
echo "0 dan 100 e kadar olan tek sayıların toplamı : ".$toplam."<br>";



************************************************************************************************************************************************************************************************************************************************************

<?php
$ay=5;
switch($ay)
{
case 0: echo "Ocak"; break;
case 1: echo "Şubat"; break;
case 2: echo "Mart"; break;
case 3: echo "Nisan"; break;
case 4: echo "Mayıs"; break;
case 5: echo "Haziran"; break;
case 6: echo "Temmuz"; break;
case 7: echo "Ağustos"; break;
case 8: echo "Eylül"; break;
case 9: echo "Ekim"; break;
case 10: echo "Kasım"; break;
case 11: echo "Aralık"; break;
default: echo "0-11 arası değer giriniz"; break;
}

?>


// aylar php

// if(empty($a))
$sicaklik=null;
//isset : değer varmı yokmu.
//empty boş ise şart.. (null boş)
if(isset($sicaklik))
{echo "değer var";}
else if(empty($sicaklik))
{echo "değer yok";}

//rmdir("mert");
unlink("sonuc.txt");
************************************************************************************************************************************************************************************************************************************************************

$dgmgn=mktime(0,0,0,10,5,2000);
$dgmtrh=getdate($dgmgn);
echo $dgmtrh["weekday"];
echo date("d F Y l",mktime(0,0,0,10,12,2017));

************************************************************************************************************************************************************************************************************************************************************


<?php
$simdi=time();
$zaman=mktime(0,0,0,1,1,2017);
$fark=abs($simdi-$zaman);
$gun=floor($fark/(24*60*60));
$saat=floor(($fark-$gun*24*60*60)/(60*60));
$dakika=floor(($fark-($gun*24*60*60+$saat*60*60))/60);
$saniye=$fark-($gun*24*60*60+$saat*60*60+$dakika*60);
echo "1 Ocak 2017 ile aramızda $gun gün $saat saat $dakika dakika $saniye saniye vardır.";
?>

// ö n e m l i

************************************************************************************************************************************************************************************************************************************************************

<?php
$sayi=rand(1,10);
$sayim=5;


$yaz=fopen("sonuc.txt","w");
fwrite($yaz,"$sayi");
fclose($yaz);


$ac=fopen("sonuc.txt","r");
while(!feof($ac))
{
$oku=fgets($ac);
echo "İstenen sayı=".$oku."<br>";
echo "Tuttuğunuz sayı=".$sayim."<br>";
if($oku>$sayim)
echo "Tahmin ettiğiniz sayı daha büyük olmalı";
else if($oku<$sayim)
echo "Tahmin ettiğiniz sayı daha küçük olmalı";
else
echo "Tebrikler tuttuğunuz sayı doğru";
}
fclose($ac);
?>


************************************************************************************************************************************************************************************************************************************************************


<?php

$simdi=time();
echo $simdi."<br>";
$dk=$simdi/60;
$saat=$dk/60;
$gun=floor($saat/24);
$yil=floor($gun/365);
echo $dk."<br>";
echo $saat."<br>";
echo $gun."<br>";
echo $yil."<br>";
echo date("d/m/y");

?>
************************************************************************************************************************************************************************************************************************************************************





-->
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.