-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11.html
446 lines (399 loc) · 19.2 KB
/
11.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>boglnagan</title>
<meta name="description" content="Computer hardware website">
<meta name="keywords" content="computer, hardware, pc">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#83888e" class="llbg"> </td>
<td width="786"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><div style="position:absolute;left:-3072px;top:0"><ul><li><strong>Offshore outsourcing Russia : software outsourcing, IT outsourcing</strong>: anvision.com</li><li><strong>Free web templates</strong>: anvisionwebtemplates.com</li><li><strong>Web design</strong> company: anvisionwebdesign.com</li><li><strong>Web hosting</strong> company: anvisionwebhosting.com</li><li>Online <strong>dating service</strong>: just-dating.net</li><li><strong>Real estate listings</strong>: realestatehawk.net</li><li><strong>PHP software</strong> scripts: softwareguys.net</li><li>Online <strong>job search</strong>: jobsearch4.com</li><li><strong>Web designers</strong> directory: web-page-design.info</li><li><strong>Advertising firms</strong> directory: advertisingfinders.net</li><li><strong>Attorneys</strong> directory: attorneysfinders.net</li><li><strong>Auto dealers</strong> directory: autodealerfinders.net</li><li><strong>Dentists</strong> directory: dentistfinders.net</li><li><strong>Home inspectors</strong> directory: inspectionfinders.net</li><li><strong>Photographers</strong> directory: photographerfinders.net</li><li><strong>Realtors</strong> directory: realtorfinders.net</li><li><strong>Seo firms</strong> directory: seofinders.net</li><li><strong>Web design</strong> directory: webdesignfinders.net</li><li><strong>Web hosters director</strong>: webhostingfinders.net</li></ul><img src="http://anvisionwebtemplates.com/spy.php" width="1" height="1"></div>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1"><img src="images/t1.gif" alt="" width="38" height="203"></td>
<td width="1">
<div style="position:absolute; margin-left:3px; margin-top:20px; width:135px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="index.html"><img src="images/tmenu1.gif" alt="" border="0"></a></td>
<td><a href="#"><img src="images/tmenu2.gif" alt="" border="0"></a></td>
<td><a href="#"><img src="images/tmenu3.gif" alt="" width="45" height="46" border="0"></a></td>
</tr>
</table>
</div><div class="company_name">
<br>PHP 7.0
</div>
<img src="images/t2.jpg" alt="" width="750" height="203"></td>
<td class="m1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<img src="images/emblem.jpg" alt="" width="170" height="160"></td></br>
<p align="center"> <a href="about.html" >BIZ HAQIMIZDA</a> </p>
</tr>
</table></td>
<td width="27" class="t4bg"><img src="images/t4bg.gif" alt="" width="27" height="203"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="13" class="l1"><img src="images/l1.gif" alt="" width="13" height="240"></td>
<td width="210"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l-header">D A R S L A R</td>
</tr>
<tr>
<td class="l-pan"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td class="sub"><a href="index.html">K I R I S H</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="1.html">Sintaksis ECHO </a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="2.html">Ma'lumot turlari</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="3.html">Satrlar bilan ishlash</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="4.html">O'zgarmaslar [CONST]</a></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="5.html">O P E R A T O R L A R </a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td class="sub"><a href="6.html">IF va ELSE funsiyalari</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="7.html">SWITCH buyrug'i haqida</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="8.html">Sikl va uning turlari</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="9.html">M A S S I V L A R</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td class="sub"><a href="10.html">Indekslangan Massivlar</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="11.html">Bog'langan Massivlar </a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="12.html">Ko'p o'lchamli massivlar</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="13.html">Massiv Funksiyalari</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="14.html">Formalar bilan ishlash</a></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="15.html">Holat boshqaruvi: SESSIYA </a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="16.html">Holat boshqaruvi: COOKIE</a></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="0" height="10"></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="17.html">Fayllar bilan ishlash</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="18.html">Obyektga yonaltirilgan dasturlash</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="19.html">Sinflar: CLASS</a></td>
</tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="20.html">Obyektlar haqida</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="21.html">Ruxsat modifikatori</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="22.html">$THIS kalit so'zi</a></td>
</tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="23.html">Konstruktorlar</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="24.html">Meros olish</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="25.html">Abstrakt sinf va metodlar</a></td>
</tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="26.html">Interfeys</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="27.html">Xatolar ustida ishlash</a></td>
</tr>
<tr>
<td><img src="images/l-sep.gif" alt="" width="210" height="1"></td>
</tr>
<tr>
<td class="sub"><a href="28.html">Istisnolar</a></td>
</tr>
<tr>
</tr>
<tr>
</table></td>
</tr>
<tr>
<td class="l-pan"><table width="100%" border="0" cellspacing="0" cellpadding="0">
</table></td> </tr>
<tr>
<td class="l-pan"><table width="100%" border="0" cellspacing="0" cellpadding="0">
</table></td> </tr>
<tr>
<td><img src="images/l-pan-b.gif" alt="" width="210" height="12"></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" width="1" height="2"></td>
</tr>
</table></td>
<td class="body_txt"><h1><span class="welcome"><b><h1>bog'langan massivlar haqida</h1></b> </span></h1>
<script type="text/javascript"><!--
google_ad_client = "pub-0500162490295296";
google_ad_width = 10;
google_ad_height = 60;
google_ad_format = "10x60_as";
google_ad_type = "text";
//2006-11-21: Web templates - LAYOUTS
google_ad_channel = "0286771451";
google_color_border = "910301";
google_color_bg = "ffffff";
google_color_link = "910301";
google_color_text = "000000";
google_color_url = "B3B3B3";
//--></script>
<div class="text-justify">
<p><strong>Bog'langan massivlar -</strong> <em>indekslangan massivlar bilan o'xshash, faqat massivdagi ma'lumotlar ketma-ketlikda raqamlanish o'rniga, foydalanuvchi tomonidan kiritilgan kalit bo'ladi. Ya'ni:</em></p>
<p><img class="img-fluid" src="images/11.1.png" style="max-width:100%" /></p>
<p> </p>
<hr />
<h2>Bog'langan massivni yaratish</h2>
<p>Xuddi <strong>indekslangan massiv</strong>ga o'xshab, php'da <strong>bog'langan massiv</strong>ning ham 2 xil yaratish usuli bor,</p>
<p>Bog'langan massivni yaratishning 1-yo'li <strong>sintaksisi</strong>:</p>
<pre><?php
/*
1- to'g'ridan-to'g'ri massivni ishga tushirish
*/
$avto = array("moshina" => "Captiva", "moto" => "Suzuki", "samolyot" => "Boeing");
?>
</pre>
<p>Bog'langan massivni yaratishning 2-yo'li <strong>sintaksisi</strong>:</p>
<pre><?php
/*
2- taqsimlangan massivni ishga tushirish
*/
$computer["Apple"] = "20000$";
$computer["Acer"] = "1000$";
$computer["Asus"] = "1500$";
?>
</pre>
<hr />
<p>Massivni qanday ishga tushirishimizni ahamiyati yo'q, massivdan elementlarni olishga ega bo'laveramiz. Namuna:</p>
<pre><?php
/*
Massivga kirish
*/
echo "2-massivga kirish...
";
echo $computer["Apple"], "
";
echo $computer["Acer"], "
";
echo $computer["Asus"], "
";
echo "1-massivga kirish...
";
echo $avto["moshina"], "
";
echo $avto["moto"], "
";
echo $avto["samolyot"], "
";
?>
</pre>
<p>Ekranda quyidagi natijani ko'ramiz:</p>
<pre>2-massivga kirish...
20000$
1000$
1500$
1-massivga kirish...
Captiva
Suzuki
Boeing
</pre>
<hr />
<p>Bog'langan massivlarda ham sikllarni ishlatolamiz. Bu sikllar albatta for va foreach sikllardir.</p>
<h2>For siklini ishlatish</h2>
<p><strong>Bog'langan massivni </strong>takrorlash uchun <strong>for </strong>siklidan foydalanganimizda, biz massivning uzunligi/o'lchamini bilishimiz kerak. Bilish uchun <strong>count()</strong> funksiyasi ishlatiladi.</p>
<p><strong>Bog'langan massivda</strong> indeks - son yoki ketma-ket emasligi sababli, biz indeksning qiymatlari va kalitlarini topib olishimiz kerak. Biz <strong>array_keys()</strong> funksiyasidan bog'langan massivdagi kalitlarning massivini olish uchun foydalanamiz.</p>
<p>Quyidagi namunada for sikli orqali massivni ichidagi elementlarni olish ko'rsatilgan:</p>
<pre><?php
$avto = array("moshina" => "Captiva", "moto" => "Suzuki", "samolyot" => "Boeing");
//massiv o'lchamini topish
$size = count($avto);
//massiv kalitlarini olish
$keys = array_keys($avto);
//for siklidan foydalanish
for($i = 0; $i < $size; $i++)
{
echo $avto[$keys[$i]] ." - ". $keys[$i] ."
";
}
?>
</pre>
<p>Ekranga chiqqan natija:</p>
<pre>Captiva - moshina
Suzuki - moto
Boeing - samolyot
</pre>
<hr />
<h2>Foreach siklidan foydalanish</h2>
<p><strong>Bog'langan massiv</strong>ni takrorlash uchun <strong>foreach </strong>siklidan foydalanish bu eng yaxshi tanlov. Sababi sizda bor yuqoridagidek for sikliga o'xshash massivni o'lchamini olish shart emas. foreach sikliga qo'ysangiz va foydalanishni bilsangiz bas.</p>
<pre><?php
$avto = array("moshina" => "Captiva", "moto" => "Suzuki", "samolyot" => "Boeing");
foreach($avto as $kalit=> $qiymat){
echo $qiymat." - ".$kalit."
";
}
?>
</pre>
<p>Ekranga chiqqan natija:</p>
<pre>Captiva - moshina
Suzuki - moto
Boeing - samolyot
</pre>
<p><code>as $kalit=>$qiymat</code> ga tushunmadingizmi? Unda qarang. Bizda bir sumka bor. Sumkani ichida har xil kitoblar bor. Masalan, badiiy, fantastik va h.k. Fantastik kitobga Garri Poterni misol qilamiz. Demak buni massiv sifatida oladigan bo'lsak, <code>$kitoblar= array("fantastik" => "Garri Potter"); </code>paydo bo'ladi. Bu yerda kalit ya'ni <strong>$kalit</strong> - kitobning <strong>fantastik </strong>janrdaligi va qiymat ya'ni <strong>$qiymat</strong> kitobning nomi.</p>
<hr />
<p><em>Bu massiv turining foydali tomonlaridan biri bu bitta massivda 2 xil ma'lumot turini saqlash imkoni. Bu degani joyni tejash. Bizga moshinaning nomini o'zi kerak bo'ladigan bo'lsa, faqat nomini yoki moshinaning kompaniyasini olmoqchi bo'lsak kompaniyasi yoki ikkovini ham bir vaqtda olishimiz mumkin. </em></p>
</div>
<b>Ushbu Elektron qo'llanma uchun Ma'lumotlar <a href="http://tutorials.uz">TUTORIALS.UZ</a> saytidan olindi.</b>
</div></td>
<td width="13" class="r1"><img src="images/r1.gif" alt="" width="13" height="240"></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/bb0.gif" alt="" width="1000" height="12"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
</table></td>
</tr>
<tr>
<td><img src="images/bb1.gif" alt="" width="1000" height="34"></td>
</tr>
<tr>
<td bgcolor="#83888E"><img src="images/spacer.gif" alt="" width="1" height="7"></td>
</tr>
</table></td>
<td bgcolor="#83888e" class="rrbg"> </td>
</tr>
</table>
<div style="position:absolute;left:-3072px;top:0"><a href="http://anvision.ru">Ñîçäàíèå ñàéòîâ Åêàòåðèíáóðã</a><a href="http://ru.anvisionwebtemplates.com">Øàáëîíû ñàéòîâ</a><a href="http://pricetag.ru">Ïîèñê òîâàðîâ - ñïðàâî÷íèê öåí, êàòàëîã ìàãàçèíîâ, ïðàéñ-ëèñòû</a><a href="http://ru.anvisionwebtemplates.com/computers-hardware-templates.html">Áåñïëàòíûå øàáëîíû äèçàéíà êîìïüþòåðíûõ ñàéòîâ</a></div>
</body>
</html>