IRCRehberi.Net- Türkiyenin En iyi IRC ve Genel Forum Sitesi

IRCRehberi.Net- Türkiyenin En iyi IRC ve Genel Forum Sitesi (https://www.ircrehberi.net/)
-   Webmaster Genel (https://www.ircrehberi.net/webmaster-genel/)
-   -   PHP Tür Dönüşüm Fonksiyonları (https://www.ircrehberi.net/webmaster-genel/74665-php-tur-donusum-fonksiyonlari.html)

ExCaLuBuR 20 Haziran 2021 05:14

PHP Tür Dönüşüm Fonksiyonları
 
  • boolval()
  • doubleval()
  • floatval()
  • intval()
  • strval()


intval()


Bir değişkenin tamsayı değerini döndürür.


PHP- Kodu:

<?php
echo intval(42);                      // 42
echo intval(4.2);                     // 4
echo intval('42');                    // 42
echo intval('+42');                   // 42
echo intval('-42');                   // -42
echo intval(042);                     // 34
echo intval('042');                   // 42
echo intval(1e10);                    // 1410065408
echo intval('1e10');                  // 1
echo intval(0x1A);                    // 26
echo intval(42000000);                // 42000000
echo intval(420000000000000000000);   // 0
echo intval('420000000000000000000'); // 2147483647
echo intval(428);                   // 42
echo intval('42'8);                 // 34
echo intval(array());                 // 0
echo intval(array('foo''bar'));     // 1
?>


bolval()

Bir değişkenin bool değerini döndürür.


PHP- Kodu:

<?php
echo boolval(0);    //false;
echo boolval(42);   //true
echo boolval(0.0);  //false
echo boolval(4.2);  //true
echo boolval("");   //false
echo boolval("string");//true;
echo boolval("0");  //false
echo boolval("1");  //true
echo boolval([12]);//true
echo boolval([]);   //false
?>


Değişkenler ile Kullanılan Diğer Fonksiyonlar

  • debug_​zval_​dump()
  • get_​defined_​vars()
  • get_​resource_​type()
  • gettype()
  • is_​double()
  • is_​integer()
  • is_​iterable()
  • is_​real()
  • is_​callable()
  • is_​resource()
  • is_​scalar()
  • is_​long()
  • is_​countable()
  • is_​object()
  • unserialize()
  • settype()
  • serialize()
  • var_​export()

KuzenKit 20 Haziran 2021 09:59

Emeğine sağlık, paylaşım için teşekkürler.

She 24 Haziran 2021 07:57

Elinize sağlık @[Üye Olmadan Linkleri Göremezsiniz. Lütfen Üye Olmak için TIKLAYIN...]


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 06:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.

Copyright ©2019 - 2025 | IRCRehberi.Net