Iwe unogona kunge uchitsvaga nhanho-ne-nhanho dzidziso yephp programmierung. Ichi chinyorwa chinobata misoro yakaita seTypdeklarationen, siyana tsanangudzo, PHP shanduro, uye PHP-GTK. Mushure mekuiverenga, iwe unofanirwa kukwanisa kukodha akareruka ewebhu maapplication zviri nyore. Asi ko kana uine mibvunzo kana usina chokwadi pekutangira? Takakufukidza iwe!
Iyo itsva vhezheni yePP 7 inowedzera scalartypes kuita kuti mabasa ave nyore kushandisa. Iyi mitauro-yakamisikidzwa inobvumira vanogadzira kuchinjanisa marudzi pese pazvinoda. Vashandisi vatsva, kusanganisira Spaceship Operator, zadzisa syntax yemutauro. Aya ndiwo ekuwedzera mitauro mishanu. Typdeklarationen zviziviso zverudzi. Mune PHP, mhando kana tambo, nhamba, basa, kana musanganiswa wemhando.
Mune PHP, unogona kushandisa strripos basa kusiyanisa pakati pediki uye gross-spelling. achakurura() yakaunzwa muPHP 5.0. Pakuenzanisa tambo, ita chokwadi chekushandisa kuenzana chaiko (===) kudzivirira mukana wemhedzisiro isiriyo. Rimwe basa ndiro stripos(). Izvo zvakafanana ne strpos(), asi hazvifungidzire zviperengo zvidiki kana gross.
Kushanda kwetambo kunogona kunetsa kunzwisisa usingazive syntax yemutauro. Nguva dzose-yekutaura-yakavakirwa mabasa anogona kubatsira. Semuyenzaniso, tambo vanoshanda sekupatsanurwa() uye preg_split() inoda ruzivo rweArrays. Mune PHP, zvisinei, zviri nyore. Nguva dzose-yekutaura-yakavakirwa mabasa, zvakadai kuwana() uye kuisa(), ita kuti tambo manipulation iite kamhepo. Kana uchida kuita tsvakiridzo yenguva dzose, unogona kushandisa preg_split() kuita saizvozvo.
Mavhezheni ePP ehurongwa ndeweiyo yakakura runyorwa rwe server-parutivi programming mitauro inowanikwa paInternet.. Iyi rondedzero inosanganisira PHP 5.3, 5.4, 5.6, 7.0, uye 7.1. Ese aya mavhezheni ane kuvandudzwa uye kugadzirisa kwematambudziko apfuura. Zvinokurudzirwa kuti uvandudze kune yazvino vhezheni pese pazvinogoneka. Zvisinei, zvakakoshawo kufunga kuti PHP shanduro dzinodzimwa mushure meimwe nguva yenguva.
Nepo kuvandudza hakuna kuoma sezvazvinonzwika, kunosanganisira rimwe basa. Ungangoda kugadzirisa nyaya, tsiva yekare plug-ins, kana kubata nekuchengetedza optimizations. Zvakanaka, unofanira kuyedza chero shanduko yaunoita munzvimbo yakachengeteka isina Indaneti kutanga. Nenzira iyi, unogona kuwana chero nyaya dzisati dzakanganisa yako mhenyu webhusaiti. Kana ukasangana nematambudziko uchiyedza shanduko, unogona kutendeukira kunharaunda yePHP kuti uwane rutsigiro kana rubatsiro.
PHP yakatanga kugadzirwa mukati 1994. Yekutanga vhezheni yakaburitswa seti yePerl zvinyorwa uye yaive nechinangwa chekutarisa webhusaiti traffic. In 1996, Rasmus Lerdorf akatamira kuC uye akawedzera sarudzo nyowani. The Personal Peji Zvishandiso (PHP) chirongwa chakatangwa. In 1997, a formal developer team yakaumbwa kugadzirisa kusawirirana kwePHP version one. Panguva iyoyo, PHP yakura kuita chirongwa chikuru chekuvandudza webhu.
Paunenge uchinyora maapplication neiyo PHP-GTK mutauro, iwe unofanirwa kujairana neiyo yekutanga pfungwa yemhuri dzekirasi. Mumhuri yeGdk, semuyenzaniso, iwe uchashandisa makirasi anomiririra yakaderera-level windows uye mavara. Mhuri yeGtk yakanyanya kuoma uye ine makirasi ari pamusoro-soro uye anogona kunge aine mamwe makirasi, kusanganisira dzausingashandisi. Muchinyorwa chino, tichatsanangura kuti mhuri dzemakirasi dzinoshanda sei uye kuti sei ungadzishandisa.
Iyo PHP-GTK application inogona kuita chero chero chinhu, kubva kune zvemukati manejimendi masisitimu uye zvinyorwa zvinyorwa kune IRC vatengi uye network monitors. Kunyange vapepeti vemashoko vanogona kuitwa vachishandisa mutauro uyu. Zvinotogoneka kuishandisa kune yakavhurika sosi mapurojekiti. Imwe application inogona kunge iri yenhau yekuona inodhonza misi yakakosha kubva kune yepakati server. Chimwe chishandiso chinogona kusanganisira dhatabhesi yepasi kana spreadsheet. Iwe unogona zvakare kushandisa PHP-GTK yekuongorora nhamba.
PHP-GTK isarudzo yakanakisa yemazuva ese ewebhu maapplication. Iyo yakanaka zvakare kune network uye inopa maficha kuJava uye.NET. Inogona zvakare kushandiswa kune yakapusa mutengi-parutivi yakamira maapplication. Iwe unogona kutonyora mapurogiramu anomhanya paMacs, saka isarudzo yakanakisa yekuvandudza webhu. Kana iwe usina chokwadi chekuti PHP-GTK yakakodzera purojekiti yako, tanga nekuverenga aya matipi akakosha.
Kana iwe uri mutsva kumutauro wePHP, chinhu chekutanga chaunofanira kudzidza ndechekuti ungashandisa sei PHP-muturikiri. Iyi purogiramu inomhanya pakombuta yako uye inodudzira iyo PHP makodhi. PHP mutauro wakadudzirwa, saka muturikiri anotarisa data rawakumbira mudhatabhesi uye oridzosera iri muchimiro chewebhu peji reHTML. Iri faira rinozotumirwa kune yako webhu server, iyo ichaendeswa kune browser yako. Unogona kuona chirongwa chePHP pakombuta yako nekuenda kune localhost/foldername uye nekuinyora mubrowser yako.
Muturikiri wePHP akafanana neanoshanda naye ane usimbe. Inongoshanda chete kana faira iri muPP format yakumbirwa, saka paunoshanyira webhusaiti, muturikiri achagadzirisa script yePHP uye kunyora nguva uye zuva kugwaro reHTML. Kana iyo faira yaendeswa kune web server, browser ichairatidza. Inogona kushanda nemimwe mitauro yekunyora sePerl, Python, kana Ruby.
PHP scripts programming inogona kushandiswa kune chero chinangwa, kusanganisira kuvandudzwa kwewebhu, text processing, uye kuvandudzwa kwemutambo. Aya magwaro anogona kushanda pasina kushandisa sevha kana browser, uye inoda chete PHP-parser kuti ishande. PHP zvinyorwa zvinonyanya kukodzera kudzokorodza mabasa akadai seemail uye webhu kuvandudza, uye zviri nyore kuverenga kana vaine ma parameter mashoma.
A PHP-Skripte ndeye PHP-script inoshandisa kudyidzana uye zvine simba zvemukati. Kana yashandiswa, PHP-Skripts inochengetwa mune yakasarudzika dhairekitori. Iri dhairekitori rinobva rashandiswa kuratidza iyo PHP-Skripte pane webhusaiti. Pamusoro pekuvandudzwa kwewebhu, PHP-Skripte Programmierung inobvumira vatungamiri vewebhu kupa zvakasiyana-siyana zvekuwedzera kushanda.
Iyo PHP-skripte nharaunda inotanga neiyo php tag. Mutsetse unotevera une mirairo echo uye Hello World! kugadzira HTML inobuda. Iyo tambo pachayo inosiyana kureba uye inoonekwa seyakazvimirira datatype. Nekuda kwekuzvimiririra kwayo pachikuva, PHP script inogona kunge yakazara zvakanyanya – kunyange kana yakashandiswa pamwe chete nedatabase. Kana iwe uchida kugadzira imwe mushandisi-inoshamwaridzika saiti, funga PHP scripts programming
Kana zvasvika kune server-side scripting yemawebhusaiti, PHP isarudzo yakanaka. Mutauro wekunyora uyu une zvakawanda zvakasiyana-siyana zvetiweki, protocol interfaces, uye kuwana database. Zviri nyore kudzidza uye inopa huwandu hukuru hwemikana yekushandisa. Pamusoro pemaseva ewebhu, PHP inogona kushandiswa kugadzira desktop application uye cron zvinyorwa. Pazasi pane mamwe akakosha maficha ePP aunofanirwa kujairana nawo.
Yekutanga uye yakakosha nhanho pakushandisa PHP ndeyekudzidza izvo zvekutanga. Mutauro uyu unokutendera kuti ugadzire mawebhusaiti ane ruzivo rushoma rweHTML, uye inokwanisa kudyidzana nedatabase. Unogona kushandisa izvi kuti zvikubatsire. PHP ndiyo yazvino vhezheni yemutauro uyu uye ine zvimwe zvakawanda zvakanaka. Zvisinei, unofanira kugara uchiyeuka kutevera zvakanakisisa maitiro paunenge uchishanda nawo. Kana uine mubvunzo, unogona kugara uchindibata. Ndichafara kukubatsira!
Kana iwe uri mutsva kune PHP chirongwa, Ndinokukurudzira kuti utange nemimwe mienzaniso yehurongwa hwekutanga uye wozovaka ruzivo rwako paunenge uchienderera mberi. Chimwe chezvinhu zvakanakisa nezve PHP ndechekuti inogona kumhanya pane chero chikuva. Pamusoro pe, inonyanya kushandiswa uye inogona kushandiswa kune chero chinangwa. Kana iwe uri wekutanga, PHP mutauro wakanaka kwauri. Kusiyana neHTML, PHP haisi nyore chete kudzidza, asi zvakare yakanaka kuchinjika.
A PHP script igwaro rakadudzirwa rakanyorwa mumutauro wepurogiramu yePHP. Inogona kushandiswa kugadzira mapeji ewebhu. PHP zvinyorwa zvinoshandisa zvakasiyana, izvo tambo kana nhamba dzinobatanidza data rekunze kune script. Variables inogona kumiririra chero chinhu kubva kunhamba dziri nyore kusvika kune zviratidzo, text, kana kunyange yakazara HTML makodhi. Izvo zvinosiyana zvinowanzova zve datatype tambo. Mhando yekutanga yekukosha itambo, chinova chinoshanduka chinogona kuva chero hurefu. Haisi chikamu cheimwe datatype. Semuyenzaniso, tambo “mhoro nyika” inoonekwa seUberschrift, inova kukosha kwekutanga kududzirwa newebhu browser.
Kazhinji, iyo PHP-Skripte ine zvese HTML uye chirongwa chepfungwa. Nzira yakajairika yekuparadzanisa maviri ndeye kushandisa faira rakasiyana kune yega yega. Kune vanotanga, zvakakosha kugadzirisa nzvimbo yekusimudzira yakagadzikana. Usashande pamaseva eruzhinji, asi isa test web server kudzivirira kukonzeresa chero matambudziko. Ita shuwa kuti webhu server marongero akafanana neyekugadzira system. Zvakare, funga kuti uchachinjana sei data pakati pePP-scripts neHTML.