PHP Eğitimi

PHP ANA SAYFA PHP'ye Giriş PHP Kurulumu PHP Sözdizimi PHP Yorumları PHP Değişkenleri PHP Yankı / Yazdır PHP Veri Türleri PHP Dizeleri PHP Numaraları PHP Matematik PHP Sabitleri PHP Operatörleri PHP If...Else...Elseif PHP Anahtarı PHP Döngüleri PHP Fonksiyonları PHP Dizileri PHP Süper Küreseller PHP Normal İfade

PHP Formları

PHP Form İşleme PHP Form Doğrulama PHP Formu Gerekli PHP Formu URL/E-posta PHP Formu Tamamlandı

PHP Gelişmiş

PHP Tarih ve Saat PHP Dahil PHP Dosya İşleme PHP Dosyası Aç/Oku PHP Dosyası Oluştur/Yaz PHP Dosya Yükleme PHP Çerezleri PHP Oturumları PHP Filtreleri PHP Filtreleri Gelişmiş PHP Geri Çağırma İşlevleri PHP JSON'u PHP İstisnaları

PHP OOP

PHP OOP nedir PHP Sınıfları/Nesneleri PHP Oluşturucu PHP Yıkıcı PHP Erişim Değiştiricileri PHP Kalıtımı PHP Sabitleri PHP Soyut Sınıfları PHP Arayüzleri PHP Özellikleri PHP Statik Yöntemler PHP Statik Özellikler PHP Ad Alanları PHP Yinelenebilirler

MySQL Veritabanı

MySQL Veritabanı MySQL Bağlantısı MySQL Veritabanı Oluştur MySQL Tablo Oluştur MySQL Veri Ekle MySQL Son Kimliği Al MySQL Ekle Çoklu MySQL Hazırlandı MySQL Seçim Verisi MySQL Nerede MySQL Sıralaması MySQL Verileri Sil MySQL Güncelleme Verileri MySQL Sınır Verileri

PHP XML'i

PHP XML Ayrıştırıcıları PHP SimpleXML Ayrıştırıcı PHP SimpleXML - Al PHP XML Expat'ı PHP XML DOM'si

PHP - AJAX

AJAX'a Giriş AJAX PHP AJAX Veritabanı AJAX XML'i AJAX Canlı Arama AJAX Anketi

PHP Örnekleri

PHP Örnekleri PHP Derleyici PHP Testi PHP Alıştırmaları PHP Sertifikası

PHP Referansı

PHP'ye Genel Bakış PHP Dizisi PHP Takvimi PHP Tarihi PHP Dizini PHP Hatası PHP İstisnası PHP Dosya Sistemi PHP Filtresi PHP FTP'si PHP JSON'u PHP Anahtar Kelimeler PHP Libxml PHP Postası PHP Matematik PHP Çeşitli PHP MySQLi PHP Ağı PHP Çıkış Kontrolü PHP Normal İfade PHP SimpleXML PHP Akışı PHP Dizisi PHP Değişken İşleme PHP XML Ayrıştırıcı PHP Posta Kodu PHP Saat Dilimleri

PHP Operatörleri


PHP Operatörleri

Operatörler, değişkenler ve değerler üzerinde işlem yapmak için kullanılır.

PHP, operatörleri aşağıdaki gruplara ayırır:

  • Aritmetik operatörler
  • atama operatörleri
  • karşılaştırma operatörleri
  • Artırma/Azaltma operatörleri
  • Mantıksal operatörler
  • dize operatörleri
  • dizi operatörleri
  • Koşullu atama operatörleri

PHP Aritmetik Operatörleri

PHP aritmetik operatörleri, toplama, çıkarma, çarpma gibi genel aritmetik işlemleri gerçekleştirmek için sayısal değerlerle kullanılır.

Operator Name Example Result Show it
+ Addition $x + $y Sum of $x and $y
- Subtraction $x - $y Difference of $x and $y
* Multiplication $x * $y Product of $x and $y
/ Division $x / $y Quotient of $x and $y
% Modulus $x % $y Remainder of $x divided by $y
** Exponentiation $x ** $y Result of raising $x to the $y'th power

PHP Atama Operatörleri

PHP atama operatörleri, bir değişkene değer yazmak için sayısal değerlerle birlikte kullanılır.

PHP'deki temel atama operatörü "="'dir. Bu, sol işlenenin sağdaki atama ifadesinin değerine ayarlandığı anlamına gelir.

Assignment Same as... Description Show it
x = y x = y The left operand gets set to the value of the expression on the right
x += y x = x + y Addition
x -= y x = x - y Subtraction
x *= y x = x * y Multiplication
x /= y x = x / y Division
x %= y x = x % y Modulus


PHP Karşılaştırma Operatörleri

PHP karşılaştırma operatörleri iki değeri (sayı veya dize) karşılaştırmak için kullanılır:

Operator Name Example Result Show it
== Equal $x == $y Returns true if $x is equal to $y
=== Identical $x === $y Returns true if $x is equal to $y, and they are of the same type
!= Not equal $x != $y Returns true if $x is not equal to $y
<> Not equal $x <> $y Returns true if $x is not equal to $y
!== Not identical $x !== $y Returns true if $x is not equal to $y, or they are not of the same type
> Greater than $x > $y Returns true if $x is greater than $y
< Less than $x < $y Returns true if $x is less than $y
>= Greater than or equal to $x >= $y Returns true if $x is greater than or equal to $y
<= Less than or equal to $x <= $y Returns true if $x is less than or equal to $y
<=> Spaceship $x <=> $y Returns an integer less than, equal to, or greater than zero, depending on if $x is less than, equal to, or greater than $y. Introduced in PHP 7.

PHP Artırma / Azaltma Operatörleri

PHP artış operatörleri, bir değişkenin değerini artırmak için kullanılır.

PHP azaltma operatörleri, bir değişkenin değerini azaltmak için kullanılır.

Operator Name Description Show it
++$x Pre-increment Increments $x by one, then returns $x
$x++ Post-increment Returns $x, then increments $x by one
--$x Pre-decrement Decrements $x by one, then returns $x
$x-- Post-decrement Returns $x, then decrements $x by one

PHP Mantıksal Operatörler

PHP mantıksal operatörleri, koşullu ifadeleri birleştirmek için kullanılır.

Operator Name Example Result Show it
and And $x and $y True if both $x and $y are true
or Or $x or $y True if either $x or $y is true
xor Xor $x xor $y True if either $x or $y is true, but not both
&& And $x && $y True if both $x and $y are true
|| Or $x || $y True if either $x or $y is true
! Not !$x True if $x is not true

PHP Dizi Operatörleri

PHP, dizeler için özel olarak tasarlanmış iki operatöre sahiptir.

Operator Name Example Result Show it
. Concatenation $txt1 . $txt2 Concatenation of $txt1 and $txt2
.= Concatenation assignment $txt1 .= $txt2 Appends $txt2 to $txt1

PHP Dizi Operatörleri

PHP dizi operatörleri, dizileri karşılaştırmak için kullanılır.

Operator Name Example Result Show it
+ Union $x + $y Union of $x and $y
== Equality $x == $y Returns true if $x and $y have the same key/value pairs
=== Identity $x === $y Returns true if $x and $y have the same key/value pairs in the same order and of the same types
!= Inequality $x != $y Returns true if $x is not equal to $y
<> Inequality $x <> $y Returns true if $x is not equal to $y
!== Non-identity $x !== $y Returns true if $x is not identical to $y

PHP Koşullu Atama Operatörleri

PHP koşullu atama operatörleri, koşullara bağlı olarak bir değer ayarlamak için kullanılır:

Operator Name Example Result Show it
?: Ternary $x = expr1 ? expr2 : expr3 Returns the value of $x.
The value of $x is expr2 if expr1 = TRUE.
The value of $x is expr3 if expr1 = FALSE
?? Null coalescing $x = expr1 ?? expr2 Returns the value of $x.
The value of $x is expr1 if expr1 exists, and is not NULL.
If expr1 does not exist, or is NULL, the value of $x is expr2.
Introduced in PHP 7

PHP Alıştırmaları

Egzersizlerle Kendinizi Test Edin

Egzersiz yapmak:

10İle çarpın 5ve sonucu yazdırın.

echo 10  5;