1
00:00:00,000 --> 00:00:00,330

2
00:00:00,330 --> 00:00:02,860
>> DAVID Malan: Ejja jikteb programm
PHP li iqajjem l-utent għal

3
00:00:02,860 --> 00:00:05,350
integer u mbagħad jiddetermina
jekk dik integer huwa

4
00:00:05,350 --> 00:00:07,690
pożittiv, 0, jew negattiv.

5
00:00:07,690 --> 00:00:11,480
Hawnhekk f'kundizzjonijiet-1.php, stajt diġà
gotten us bdiet bil-ftuħ u

6
00:00:11,480 --> 00:00:13,160
għeluq ta 'tag PHP.

7
00:00:13,160 --> 00:00:17,320
Ejja ewwel tiddikjara varjabbli,
sempliċiment billi tagħmel $ n.

8
00:00:17,320 --> 00:00:20,260
Is-sinjal dollaru jindika li dan huwa
varjabbli, u l-avviż li aħna ma

9
00:00:20,260 --> 00:00:21,770
jeħtieġ li tipprovdi tip ta 'data.

10
00:00:21,770 --> 00:00:24,900
>> Ejja issa jitolbu funzjoni msejħa
readLine, li huwa simili fl-ispirtu

11
00:00:24,900 --> 00:00:29,300
li getString fil-librerija CS50 għall C.
Iżda readLine wkoll tieħu argument

12
00:00:29,300 --> 00:00:32,600
li jispeċifika fil-pront li youd
jixtiequ juru lill-utent.

13
00:00:32,600 --> 00:00:36,660
Per eżempju, nixtieq
integer jekk jogħġbok.

14
00:00:36,660 --> 00:00:38,910
>> Ejja issa tanalizza input-utent.

15
00:00:38,910 --> 00:00:45,860
Jekk n hija akbar minn 0, allura ejja print
bl printf, inti qabad

16
00:00:45,860 --> 00:00:48,880
numru pożittiv.

17
00:00:48,880 --> 00:00:56,750
inkella jekk n ikun egwali għal 0, allura ejja print
bl printf, inti qabad 0.

18
00:00:56,750 --> 00:01:01,560
U fl-aħħarnett, inkella jekk in-numru
preżumibbilment negattiv, ejja jistampa

19
00:01:01,560 --> 00:01:06,680
ma printf, inti qabad
numru negattiv.

20
00:01:06,680 --> 00:01:11,540
>> Ejja issa jiffranka dan il-fajl u tgħaddih
permezz ta 'l-interpretu PHP -

21
00:01:11,540 --> 00:01:13,053
PHP kondizzjonijiet 1.php.

22
00:01:13,053 --> 00:01:16,010

23
00:01:16,010 --> 00:01:17,230
Nixtieq integer jekk jogħġbok.

24
00:01:17,230 --> 00:01:19,510
Kif madwar 50?

25
00:01:19,510 --> 00:01:20,960
A numru pożittiv.

26
00:01:20,960 --> 00:01:23,195
>> Ejja run mill-ġdid ma ', ngħidu aħna, 0.

27
00:01:23,195 --> 00:01:24,500
I telgħet 0.

28
00:01:24,500 --> 00:01:27,640
Ejja run mill-ġdid ma ',
jgħidu, negattiva 50.

29
00:01:27,640 --> 00:01:29,430
And I tabilħaqq qabad numru negattiv.

30
00:01:29,430 --> 00:01:34,330
Iżda avviż, aktar importanti, just
kif simili dan sintassi huwa li C.

31
00:01:34,330 --> 00:01:35,526