Difference between revisions of "PHP-and-MySQL/C2/Multi-Dimensional-Arrays/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with '{| border=1 !Time !Narration |- |0:00 |A multidimensional array is an array in which you can store other arrays. |- |0:06 |It is very similar to an associative array. |- |0:09 |…')
 
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{| border=1
 
{| border=1
!Time
+
|'''Time'''
!Narration
+
|'''Narration'''
 
|-
 
|-
|0:00  
+
|00:00  
|A multidimensional array is an array in which you can store other arrays.
+
|A '''multidimensional array''' is an '''array''' in which you can store other arrays.
 
|-
 
|-
|0:06
+
|00:06
|It is very similar to an associative array.
+
|It is very similar to an '''associative array'''.
 
|-
 
|-
|0:09
+
|00:09
 
|However, the associates for this array are arrays themselves.
 
|However, the associates for this array are arrays themselves.
 
|-
 
|-
|0:14
+
|00:14
|For a better understanding, let us start the program.
+
|For a better understanding, let us start the '''program'''.
 
|-
 
|-
|0:19
+
|00:19
|I will create a program that lets you see the  position of a letter in the English  
+
|I will create a program that lets you see the  position of a letter in the English alphabet.
alphabet.
+
 
|-
 
|-
|0:26
+
|00:26
|For example, if I give the value 1, it should echo out "A" in position 1.
+
|For example, if I give the value 1, it should '''echo''' out '''"A" in position 1'''.
 
|-
 
|-
|0:33
+
|00:33
|If I give the value two it would say "B" in position 2.  
+
|If I give the value two, it should say '''"B" in position 2'''.  
 
|-
 
|-
|0:38
+
|00:38
|And for three, it will say  "C" is in position 3, and so on.
+
|And, for three, it will say  '''"C" is in position 3''' and so on.
 
|-
 
|-
|0:43  
+
|00:43  
|First I will create my own array.
+
|First, I will create my own array.
 
|-
 
|-
|0:53  
+
|00:53  
|And just for easy viewing, I will bring this down.
+
|And, just for easy viewing, I will bring this down.
 
|-
 
|-
|0:58  
+
|00:58  
 
|You are quite welcome to do so yourself.
 
|You are quite welcome to do so yourself.
 
|-
 
|-
|1:01  
+
|01:01  
|And inside. I will create my own array, which I will call ‘ABC’.
+
|And inside, I will create my own '''array''' which I will call "ABC".
 
|-
 
|-
|1:10  
+
|01:10  
|That will be the array.
+
|That will be the '''array'''.
 
|-
 
|-
|1:15  
+
|01:15  
 
|Instead of putting a value here, as we did before, we have an array inside.
 
|Instead of putting a value here, as we did before, we have an array inside.
 
|-
 
|-
|1:24
+
|01:24
|And inside these, will be the values, for example, Capital A, B, C and D.
+
|And inside this, will be the values. For example, Capital A, B, C and D
 
|-
 
|-
|1:32
+
|01:32
|And these values will be separated by commas.
+
|and these values will be separated by commas.
 
|-
 
|-
|1:41
+
|01:41
|And then we type “123” and that is equal to an array.
+
|And then we type “123” and that is equal to an '''array'''.
 
|-
 
|-
|1:46
+
|01:46
|Now we’re just going to have ‘1,2,3,4, and that’s it.
+
|Now we’re just going to have 1,2,3,4, and that’s it.
 
|-
 
|-
|1:53
+
|01:53
|Down here, I’ll show you how to echo out specific data inside the array.
+
|Down here, I’ll show you how to '''echo''' out specific data inside the array.
 
|-
 
|-
|1:59
+
|01:59
 
|We’ll call our main array.
 
|We’ll call our main array.
 
|-
 
|-
|2:02
+
|02:02
 
|And we’ll call this array as well.
 
|And we’ll call this array as well.
 
|-
 
|-
|2:05  
+
|02:05  
|And then the position of what you want inside the array. So it is an array inside an array.
+
|And then the position of what you want inside the array. So, it is an array inside an array.
 
|-
 
|-
|2:13
+
|02:13
|So I will just type ‘echo’ and then ‘alpha’ which is our main array.
+
|So, I will just type '''echo''' and then '''$alpha''' which is our main array
 
|-
 
|-
|2:19
+
|02:19
|And then inside square brackets, ‘ABC’.
+
|and then inside square brackets, 'ABC'.
 
|-
 
|-
|2:23  
+
|02:23  
|And next, inside square brackets, the position of the element if you want to retrieve.
+
|And next, inside square brackets, the position of the element, if you want to retrieve.
 
|-
 
|-
|2:30  
+
|02:30  
 
|Now, for example, is going to echo "A".
 
|Now, for example, is going to echo "A".
 
|-
 
|-
|2:35
+
|02:35
 
|Let us give that a run - and we got "A".
 
|Let us give that a run - and we got "A".
 
|-
 
|-
|2:47  
+
|02:47  
 
|Changing this to ‘123’, will hopefully give us "1".
 
|Changing this to ‘123’, will hopefully give us "1".
 
|-
 
|-
|2:54  
+
|02:54  
 
|As you can see here.
 
|As you can see here.
 
|-
 
|-
|2:57  
+
|02:57  
|So we've made our two basic arrays inside our main arrays, and we’ve learnt to call it.
+
|So we've made our two basic arrays inside our main array and we’ve learnt to call it.
 
|-
 
|-
|3:05  
+
|03:05  
|Now I’m going to create a new program to find out the position of a letter in relation to its number.
+
|Now I’m going to create a new program to find out the position of a letter, in relation to its number.
 
|-
 
|-
|3:13  
+
|03:13  
|I’m going to type up here postion = 0’, since 0 is the beginning.
+
|I’m going to type up here postion = 0''' since 0 is the beginning.
 
|-
 
|-
|3:30
+
|03:30
|Now I will echo out ‘Letter something is in position something’.
+
|Now I will '''echo''' out " '''Letter''' something '''is in position''' something".
 
|-
 
|-
|3:39
+
|03:39
 
|This is going to be quite simple.
 
|This is going to be quite simple.
 
|-
 
|-
|3:42
+
|03:42
|We enter a position here, say 3. Since C is in position 3 in the alphabet, we get C.
+
|We enter a position here, say 3; since "C" is in position 3 in the alphabet, we get "C".
 
|-
 
|-
|3:53
+
|03:53
|So , to echo out our letter, if I am going to replace the first blank with ‘alpha’.
+
|So , to echo out our letter, if I am going to replace the first blank with '''$alpha'''
 
|-
 
|-
|4:02  
+
|04:02  
|ABC
+
|'ABC'
 
|-
 
|-
|4:05  
+
|04:05  
|'pos'
+
|'$pos'
 
|-
 
|-
|4:07  
+
|04:07  
 
|as 'pos' represents our position.
 
|as 'pos' represents our position.
 
|-
 
|-
|4:11  
+
|04:11  
|So then, the position will be - Alpha...  123
+
|So then, the position will be - $alpha...  '123'
 
|-
 
|-
|4:19  
+
|04:19  
|And then the position, ‘pos’.
+
|and then the position ‘$pos’.
 
|-
 
|-
|4:23
+
|04:23
 
|At the moment, position is equal to 0.
 
|At the moment, position is equal to 0.
 
|-
 
|-
|4:29  
+
|04:29  
 
|We type ’echo something’. So this is position zero.
 
|We type ’echo something’. So this is position zero.
 
|-
 
|-
|4:36
+
|04:36
|Position zero inside the internal array “ABC”. So in actual fact, we are saying that A is in position 0,
+
|Position zero inside the internal array 'ABC'. So in actual fact, we are saying that "A" is in position 0
 
|-
 
|-
|4:47
+
|04:47
|which is this array, 123 and that is position zero. So actually we are saying letter A is in position one.
+
|which is this array 123 and that is position zero. So, actually we are saying letter "A" is in position one.
 
|-
 
|-
|4:56
+
|04:56
|Lets run this. Okay. A is in position 1. Let’s change this to 1.
+
|Let's run this. Okay. "A" is in position 1. Let’s change this to 1.
 
|-
 
|-
|5:05
+
|05:05
|Refresh. Letter B is in position 2. Now what I will do to make this application fully functional and easy to navigate, is eliminate the necessity to write zero for 1.
+
|'''Refresh'''. "Letter B is in position 2". Now what I will do to make this application fully functional and easy to navigate is, eliminate the necessity to write zero for 1.
 
|-
 
|-
|5:21
+
|05:21
 
|So I will put ‘-1’ at the end and  put 1 in brackets for better legibility.
 
|So I will put ‘-1’ at the end and  put 1 in brackets for better legibility.
 
|-
 
|-
|5:28
+
|05:28
|So, position one minus one is infact zero. So, writing 1 will give the same result as writing 0. Writing 2 will give us the same result as writing 1...letter B is in position 2.
+
|So, position one minus one is in fact zero. So, writing 1 will give the same result as writing 0. Writing 2 will give us the same result as writing 1...letter "B" is in position 2.
 
|-
 
|-
|5:43
+
|05:43
|If I put 1 then we get A is in position 1. So if I put zero here; there is no position -1; so we get “letter in position”. So we don’t have the letter or the position.
+
|If I put 1 then we get "A" is in position 1. So if I put zero here, there is no position -1; so we get “Letter is in position”. So we don’t have the letter or the position.
 
|-
 
|-
|6:01 onwards
+
|06:01
 
|So, I’ve made that a bit more user-friendly. Thanks for watching!
 
|So, I’ve made that a bit more user-friendly. Thanks for watching!

Latest revision as of 21:02, 15 December 2018

Time Narration
00:00 A multidimensional array is an array in which you can store other arrays.
00:06 It is very similar to an associative array.
00:09 However, the associates for this array are arrays themselves.
00:14 For a better understanding, let us start the program.
00:19 I will create a program that lets you see the position of a letter in the English alphabet.
00:26 For example, if I give the value 1, it should echo out "A" in position 1.
00:33 If I give the value two, it should say "B" in position 2.
00:38 And, for three, it will say "C" is in position 3 and so on.
00:43 First, I will create my own array.
00:53 And, just for easy viewing, I will bring this down.
00:58 You are quite welcome to do so yourself.
01:01 And inside, I will create my own array which I will call "ABC".
01:10 That will be the array.
01:15 Instead of putting a value here, as we did before, we have an array inside.
01:24 And inside this, will be the values. For example, Capital A, B, C and D
01:32 and these values will be separated by commas.
01:41 And then we type “123” and that is equal to an array.
01:46 Now we’re just going to have 1,2,3,4, and that’s it.
01:53 Down here, I’ll show you how to echo out specific data inside the array.
01:59 We’ll call our main array.
02:02 And we’ll call this array as well.
02:05 And then the position of what you want inside the array. So, it is an array inside an array.
02:13 So, I will just type echo and then $alpha which is our main array
02:19 and then inside square brackets, 'ABC'.
02:23 And next, inside square brackets, the position of the element, if you want to retrieve.
02:30 Now, for example, is going to echo "A".
02:35 Let us give that a run - and we got "A".
02:47 Changing this to ‘123’, will hopefully give us "1".
02:54 As you can see here.
02:57 So we've made our two basic arrays inside our main array and we’ve learnt to call it.
03:05 Now I’m going to create a new program to find out the position of a letter, in relation to its number.
03:13 I’m going to type up here postion = 0 since 0 is the beginning.
03:30 Now I will echo out " Letter something is in position something".
03:39 This is going to be quite simple.
03:42 We enter a position here, say 3; since "C" is in position 3 in the alphabet, we get "C".
03:53 So , to echo out our letter, if I am going to replace the first blank with $alpha
04:02 'ABC'
04:05 '$pos'
04:07 as 'pos' represents our position.
04:11 So then, the position will be - $alpha... '123'
04:19 and then the position ‘$pos’.
04:23 At the moment, position is equal to 0.
04:29 We type ’echo something’. So this is position zero.
04:36 Position zero inside the internal array 'ABC'. So in actual fact, we are saying that "A" is in position 0
04:47 which is this array 123 and that is position zero. So, actually we are saying letter "A" is in position one.
04:56 Let's run this. Okay. "A" is in position 1. Let’s change this to 1.
05:05 Refresh. "Letter B is in position 2". Now what I will do to make this application fully functional and easy to navigate is, eliminate the necessity to write zero for 1.
05:21 So I will put ‘-1’ at the end and put 1 in brackets for better legibility.
05:28 So, position one minus one is in fact zero. So, writing 1 will give the same result as writing 0. Writing 2 will give us the same result as writing 1...letter "B" is in position 2.
05:43 If I put 1 then we get "A" is in position 1. So if I put zero here, there is no position -1; so we get “Letter is in position”. So we don’t have the letter or the position.
06:01 So, I’ve made that a bit more user-friendly. Thanks for watching!

Contributors and Content Editors

Gaurav, Minal, PoojaMoolya, Pratik kamble, Sandhya.np14