Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHP 101
Search
Hidayet Doğan
February 27, 2014
Programming
1
740
PHP 101
Hidayet Doğan
February 27, 2014
Tweet
Share
More Decks by Hidayet Doğan
See All by Hidayet Doğan
Swoole ile Asenkron PHP
hdogan
0
780
Asenkron PHP
hdogan
0
1.5k
PHP Senfoni Orkestrası: Composer
hdogan
1
420
PHP ile Soket Programlama ve Ağ Servisleri
hdogan
5
4.3k
CakePHP ile Pasta Pişirmek
hdogan
1
880
Web Uygulamalarında Güvenlik
hdogan
1
500
Phalcon - Eklenti olarak sunulan PHP çatısı - PHP Günleri 2013#1
hdogan
5
1.6k
İnsanlar için PHP
hdogan
0
550
Phalcon - Eklenti olarak sunulan PHP çatısı
hdogan
2
2.3k
Other Decks in Programming
See All in Programming
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
250
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.3k
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
390
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
810
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
320
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
390
VS Code Update for GitHub Copilot
74th
1
400
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
160
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
370
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
230
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
110
Featured
See All Featured
It's Worth the Effort
3n
185
28k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Building Applications with DynamoDB
mza
95
6.5k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Adopting Sorbet at Scale
ufuk
77
9.4k
A better future with KSS
kneath
239
17k
A Tale of Four Properties
chriscoyier
160
23k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Designing for humans not robots
tammielis
253
25k
Transcript
PHP 101 Hidayet Doğan
Merhaba! 1995 Tübitak Bilgisayar Kulubü Linux, BASIC, C, Perl 1998
Merhaba PHP! 1999 İş Hayatı: Yazılım + Sistem 2000 İş Hayatı: Yazılım + Yönetim Fotoğraf: Onur Canalp
PHP 101 Nedir? Tarihçe Neden? Giriş Çatılar (Framework) Kaynaklar Sorular
Nedir?
Nedir? Betik Dili (Scripting Language) Sunucu Taraflı (Server Side) HTML
İçine Gömülebilir (HTML Embedded) Açık Kaynak
Tarihçe
Tarihçe 1994 Rasmus Lerdorf (Personal Home Page Tools, FI) 1995
PHP Tools, Personal Home Page Construction Kit 1996 PHP/FI 2.0 1998 PHP: Hypertext Preprocessor (PHP 3) 1998 70.000 web sitesi 2000 PHP 4 (Zend Engine)
Tarihçe 2004 PHP 5 (Zend Engine 2) 2008 PHP 4
geliştirilmesi (desteği) durduruldu. 2009 PHP 5.3 2012 PHP 5.4 2013 PHP 5.5 2014 250.000.000 web sitesi
Tarihçe <!--include header.html--> <!--getenv HTTP_USER_AGENT--> <!--ifsubstr $exec_result MSIE--> <p>Internet Explorer
kullanmasaydın iyiydi...</p> <!--endif--> <!--include footer.html-->
Tarihçe <?php include ‘header.php’; if (substr($_SERVER[‘HTTP_USER_AGENT’], ‘MSIE’)) { echo ‘<p>Internet
Explorer kullanmasaydın iyiydi...</p>’; } include ‘footer.php’; ?>
Neden?
Neden? Kariyer: 170 ilan*, 1500-8000 TL maaş Binlerce hazır fonksiyon,
eklenti, kütüphane Yaygınlık * Şubat 2014
Giriş
Menü 1 adet PHP yorumlayıcı 1 adet web sunucusu Tercihen
1 adet veritabanı sunucusu 1 adet editör
Tablot Menü apt-get install lamp-server^ Zend Server MAMP BitNami MAMP
Stack WampServer XAMPP BitNami WAMP Stack
Tablot Menü apt-get install lamp-server^ Zend Server MAMP BitNami MAMP
Stack WampServer XAMPP BitNami WAMP Stack
Kurallar • <?php ile başlar ?> ile biter. • İfadeler
; ile bitirilir.
Değişkenler $ ile başlar. Harf veya _ ile başlar. Büyük,
küçük harfe duyarlı. = ile atanır. $php
Değişkenler Sayılar (Integers), Ondalıklı Sayılar (Float/Double) Metinler (Strings) Diziler (Arrays)
Nesneler (Objects)
Sayılar ve Metinler <?php $yas = 20; $borc = 72.5;
$isim = ‘Ahmet’; $isim = “Mehmet”; ?>
Diziler <?php $notlar = array(30, 40, 27, 60); $notlar =
[30, 40, 27, 60]; $notlar = array(’vize’ => 30, ’final’ => 60); $notlar = [’vize’ => 30, ’final’ => 60]; ?>
Sınıflar <?php class Ogrenci { public $isim; protected $puan; private
$para; } ?> <?php $ahmet = new Ogrenci(); $ahmet->isim = ‘Ahmet’; ?>
Kalkulus 101 <?php $a = 12; $b = 56.5; $c
= $a + $b; ?> <?php $a = 12; $b = 5; $c = $a % $b; ?> <?php $a = 12; $b = 5; $c = ($a - $b) / 2; ?>
Sınama <?php $a = 12; $b = 7; $c =
$a > $b; $c = $a < $b; $c = $a && $b; $c = $a || $b; $c = $a == $b; ?> true false
Koşullar <?php $maas = 1750; if ($maas < 1000) {
echo ‘Fakir’; } elseif ($maas < 3000) { echo ‘Orta direk’; } else { echo ‘Zengin’; ?> <?php $dil = 1; switch ($dil) { case 1: echo ‘Türkçe’; break; default: echo ‘Diğer’; break; } ?>
Fonksiyonlar <?php function selam_soyle($isim) { echo ‘Selam ‘ . $isim;
} ?> <?php selam_soyle(‘Hidayet’); selam_soyle(‘Ramazan’); selam_soyle(‘Engür’); ?>
Fonksiyonlar <?php function selam_soyle($isim) { return ‘Selam ‘ . $isim;
} ?> <?php echo selam_soyle(‘Hidayet’); echo selam_soyle(‘Ramazan’); echo selam_soyle(‘Engür’); ?>
Eğlence <?php $a = date_sunrise(time(), SUNFUNS_RET_STRING, 39.91, 32.85, 90, 3);
echo ‘Bugün Ankara\’da güneşin doğuş saati: ‘ . $a; ?>
Çatılar (Framework)
Çatılar (Framework) Laravel Yii Framework Symfony Zend Framework CakePHP Phalcon
(Eklenti)
Kaynaklar
Kaynaklar http://php.net http://www.phptherightway.com http://www.planet-php.org http://www.reddit.com/r/PHP http://phpsecurity.readthedocs.org http://packagist.org
Kaynaklar http://ab.org.tr http://inet-tr.org.tr http://kamp.linux.org.tr http://groups.google.com/group/php-egitimleri http://php-tr.com
Sorular
Teşekkürler! http://hi.do http://github.com/hdogan http://tr.linkedin.com/in/hdogan @hdogan http://speakerdeck.com/hdogan Hidayet Doğan