<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FArrays%2FEnglish</id>
		<title>PHP-and-MySQL/C2/Arrays/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FArrays%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Arrays/English&amp;action=history"/>
		<updated>2026-05-13T01:24:39Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Arrays/English&amp;diff=832&amp;oldid=prev</id>
		<title>Pravin1389: moved PHP-and-MySQL/C2/Arrays /English to PHP-and-MySQL/C2/Arrays/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Arrays/English&amp;diff=832&amp;oldid=prev"/>
				<updated>2012-12-01T13:31:44Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/PHP-and-MySQL/C2/Arrays_/English&quot; class=&quot;mw-redirect&quot; title=&quot;PHP-and-MySQL/C2/Arrays /English&quot;&gt;PHP-and-MySQL/C2/Arrays /English&lt;/a&gt; to &lt;a href=&quot;/index.php/PHP-and-MySQL/C2/Arrays/English&quot; title=&quot;PHP-and-MySQL/C2/Arrays/English&quot;&gt;PHP-and-MySQL/C2/Arrays/English&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:31, 1 December 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pravin1389</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Arrays/English&amp;diff=530&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{|Border=1 !Time !Narration |- |0:00 |Hello and welcome to the tutorial on Arrays. |- |0:03 |Arrays allow the user to store more than one piece of data inside a variable  |- |0:0…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Arrays/English&amp;diff=530&amp;oldid=prev"/>
				<updated>2012-11-29T06:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{|Border=1 !Time !Narration |- |0:00 |Hello and welcome to the tutorial on Arrays. |- |0:03 |Arrays allow the user to store more than one piece of data inside a variable  |- |0:0…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{|Border=1&lt;br /&gt;
!Time&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|0:00&lt;br /&gt;
|Hello and welcome to the tutorial on Arrays.&lt;br /&gt;
|-&lt;br /&gt;
|0:03&lt;br /&gt;
|Arrays allow the user to store more than one piece of data inside a variable &lt;br /&gt;
|-&lt;br /&gt;
|0:08&lt;br /&gt;
|For example the variable days would be called as an array&lt;br /&gt;
|-&lt;br /&gt;
|0:12&lt;br /&gt;
|Inside a pair of parenthesis we're going to have more than one value&lt;br /&gt;
|-&lt;br /&gt;
|0:18&lt;br /&gt;
|So, I'll pick 5 values for this and have every day of the week inside each of these.&lt;br /&gt;
|-&lt;br /&gt;
|0:22&lt;br /&gt;
|I'll have Monday, Tuesday, Wednesday, Thursday and Friday - just 5 days of the week, that saves us&lt;br /&gt;
|-&lt;br /&gt;
|0:39&lt;br /&gt;
|Say for example day one is Monday, day two is Tuesday and so on.&lt;br /&gt;
|-&lt;br /&gt;
|0:49&lt;br /&gt;
|Hope you get the picture&lt;br /&gt;
|-&lt;br /&gt;
|0:51&lt;br /&gt;
|This is a much easier and more efficient way of calling a variable with more more than one piece of data inside it&lt;br /&gt;
|-&lt;br /&gt;
|00:59&lt;br /&gt;
|Please note these can also be numbers, or whatever data that you decide you require inside them.&lt;br /&gt;
|-&lt;br /&gt;
|1:06&lt;br /&gt;
|Now, to echo out our array, I'm going to say echo days&lt;br /&gt;
|-&lt;br /&gt;
|1:11&lt;br /&gt;
|Now, you find that this doesn't work.&lt;br /&gt;
|-&lt;br /&gt;
|1:15&lt;br /&gt;
|This is what happens when we open up our page&lt;br /&gt;
|-&lt;br /&gt;
|1:19&lt;br /&gt;
|We just get 'Array' echoed out.&lt;br /&gt;
|-&lt;br /&gt;
|1:22&lt;br /&gt;
|Now, 'Array' is not anywhere inside here.&lt;br /&gt;
|-&lt;br /&gt;
|1:24&lt;br /&gt;
|So, what PHP has done is echoed out the fact that what we have is an array.&lt;br /&gt;
|-&lt;br /&gt;
|1:30&lt;br /&gt;
|Now, to call a specific element inside an array, you might want to call it element, in some places they call it id tags or elements of an array.&lt;br /&gt;
|-&lt;br /&gt;
|1:41 &lt;br /&gt;
|We're going to use square brackets and we'll call the position of the element inside the array.&lt;br /&gt;
|-&lt;br /&gt;
|1:45&lt;br /&gt;
|So, you may think this is one, two, three, four, five.&lt;br /&gt;
|-&lt;br /&gt;
|1:49&lt;br /&gt;
|However because of the numbering system, the standard numbering system, we are starting with zero, one, two, three and four.&lt;br /&gt;
|-&lt;br /&gt;
|1:57&lt;br /&gt;
|So, for example if I wanted to echo out Monday that would be zero, so, you put zero in that and you have Monday echoed out.&lt;br /&gt;
|-&lt;br /&gt;
|2:06&lt;br /&gt;
|The same with one would be Tuesday and four, which is the last element in the array, would be Friday.&lt;br /&gt;
|-&lt;br /&gt;
|2:18&lt;br /&gt;
|Okay, so, we're going to go ahead and I'm going to show you how to assign values in a different way into an array&lt;br /&gt;
|-&lt;br /&gt;
|2:26&lt;br /&gt;
|Now, let me start from the beginning of what I want to say.&lt;br /&gt;
|-&lt;br /&gt;
|2:29&lt;br /&gt;
|I'm going to create an array, but I'm going to create it specifically.&lt;br /&gt;
|-&lt;br /&gt;
|2:37&lt;br /&gt;
|So, days zero equals Monday, days one equals Tuesday&lt;br /&gt;
|-&lt;br /&gt;
|2:52&lt;br /&gt;
|Now, you may think - what's the point of this? I mean, what I'm doing here essentially is creating what I said earlier would be bit of a hassle.&lt;br /&gt;
|-&lt;br /&gt;
|3:04&lt;br /&gt;
|I mean I could say day 1 equals, you know and day 2 equals, and you could do it like that.&lt;br /&gt;
|-&lt;br /&gt;
|3:14&lt;br /&gt;
|However, what we're still doing here is putting into an array.&lt;br /&gt;
|-&lt;br /&gt;
|3:19&lt;br /&gt;
|So, it may still contain the same structure but we're assigning it in a different way.&lt;br /&gt;
|-&lt;br /&gt;
|3:24&lt;br /&gt;
|So you can do it like that. Let me get rid of this.  I always prefer to do it like this.&lt;br /&gt;
|-&lt;br /&gt;
|3:32&lt;br /&gt;
|I find this much cleaner, much simpler and just to let you know - you can bring this down like this.  &lt;br /&gt;
|-&lt;br /&gt;
|3:43&lt;br /&gt;
|However if you prefer to view it, I mean if I, sorry, I'll redo that.&lt;br /&gt;
|-&lt;br /&gt;
|3:49&lt;br /&gt;
|If I save this now, refresh, nothing's changed.&lt;br /&gt;
|-&lt;br /&gt;
|3:53&lt;br /&gt;
|There are no errors, we still get the same structure, we've just moved it down on lines&lt;br /&gt;
|-&lt;br /&gt;
|4:00&lt;br /&gt;
|There's the line terminator at the end of your function and not at the the end of every line, so, don't get confused with that.&lt;br /&gt;
|-&lt;br /&gt;
|4:09&lt;br /&gt;
|Okay, so, let's now go back to this.&lt;br /&gt;
|-&lt;br /&gt;
|4:14&lt;br /&gt;
|Okay, so, that's the basic array and how to create values for it in two different ways and how to call values for it.&lt;br /&gt;
|-&lt;br /&gt;
|4:22&lt;br /&gt;
|So, for example if I was saying echo Today is days and then I can say zero.&lt;br /&gt;
|-&lt;br /&gt;
|4:33&lt;br /&gt;
|Now, you can see already that I've highlighted this in context - I've highlighted that in green&lt;br /&gt;
|-&lt;br /&gt;
|4:41&lt;br /&gt;
|Now, if you refresh this, you'll see this is Monday.&lt;br /&gt;
|-&lt;br /&gt;
|4:44&lt;br /&gt;
|Now don't get confused, I do recommend you to use contexts.&lt;br /&gt;
|-&lt;br /&gt;
|4:48&lt;br /&gt;
|However, this isn't the standard way that contact recognizes the coding.&lt;br /&gt;
|-&lt;br /&gt;
|4:53&lt;br /&gt;
|What it would look better is - you'll see that when we write it down here we could say echo 'days' and zero, you can see how that's in red to show an integer, a number.&lt;br /&gt;
|-&lt;br /&gt;
|5:08&lt;br /&gt;
|The way it would like you to write is, like that and we can see that's fine&lt;br /&gt;
|-&lt;br /&gt;
|5:15&lt;br /&gt;
|But you can incorporate an array into your string in order to echo it out.&lt;br /&gt;
|-&lt;br /&gt;
|5:22&lt;br /&gt;
|Anyway, I'm going to go on to associative arrays where we're going to assign id tags in a way where we hold a value for each...how can I describe that value for each sort of identity.&lt;br /&gt;
|-&lt;br /&gt;
|5:36&lt;br /&gt;
|If you don't follow then this is the way I'm going to create it.&lt;br /&gt;
|-&lt;br /&gt;
|5:40&lt;br /&gt;
|I'm going to say ages equals array, now inside, I'm going to say 'Alex'&lt;br /&gt;
|-&lt;br /&gt;
|6:03&lt;br /&gt;
|Now, instead of going on and saying Billy and then Kyle which are the three names I'm going to use, I'm going to say nineteen, fourteen and eighteen&lt;br /&gt;
|-&lt;br /&gt;
|6:16&lt;br /&gt;
|Basically using equals and greater than sign.&lt;br /&gt;
|-&lt;br /&gt;
|6:24&lt;br /&gt;
|Now, what this is done is instead of our array elements as in this being called by zero, this being called by one, this being called by two.&lt;br /&gt;
|-&lt;br /&gt;
|6:34&lt;br /&gt;
|This is now called as 'Alex', this is called as 'Billy' and this is called as 'Kyle' but their values are fourteen, nineteen and eighteen.&lt;br /&gt;
|-&lt;br /&gt;
|6:44&lt;br /&gt;
|So, really, it would be the same as writing that. Lets get rid of that and calling this as zero, one and two.&lt;br /&gt;
|-&lt;br /&gt;
|6:54&lt;br /&gt;
|And to make it a bit more friendly, and a bit easier to remember, a bit easier to call, we can now say, echo out 'ages', 'Alex', like that.&lt;br /&gt;
|-&lt;br /&gt;
|7:05&lt;br /&gt;
|So, this will echo out nineteen, as we refresh and see there - nineteen. The same if you do it with 'Billy' and the same with 'Kyle'.&lt;br /&gt;
|-&lt;br /&gt;
|7:22&lt;br /&gt;
|So, when you're half way through a program and instead of saying aah I'll have to go back to the top and count along each row and say &amp;quot;Is this zero, one, two or three I can't remember?&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|7:38&lt;br /&gt;
|This is much easier to do. Another useful way of doing this is, if I was to say array one is equal to 'Alex' and then two is equal to 'Billy'.&lt;br /&gt;
|-&lt;br /&gt;
|7:50&lt;br /&gt;
|We are not starting at zero and then one.  We're starting at one and two, so that you find that is easier to remember.&lt;br /&gt;
|-&lt;br /&gt;
|8:00&lt;br /&gt;
|So, we can now say echo, 'ages' one, that comes out as 'Alex'.&lt;br /&gt;
|-&lt;br /&gt;
|8:07&lt;br /&gt;
|We're not using zero for that, it's a lot more user friendly for you to program than to say, zero, one, two.&lt;br /&gt;
|-&lt;br /&gt;
|8:16&lt;br /&gt;
|Try it out - work around it - see what's easiest for you.&lt;br /&gt;
|-&lt;br /&gt;
|8:21&lt;br /&gt;
|But I mean this to me is quite pointless because I'm in the mood of using zero, one, two.&lt;br /&gt;
|-&lt;br /&gt;
|8:27&lt;br /&gt;
|But if you want to use it like I have before or like this or assign a string value to any data types then that's the way to do it&lt;br /&gt;
|-&lt;br /&gt;
|8:36&lt;br /&gt;
|Okay, that's the basics of arrays, I have another tutorial on multidimensional arrays.&lt;br /&gt;
|-&lt;br /&gt;
|8:44&lt;br /&gt;
|Its a separate tutorial.  Please watch it.&lt;br /&gt;
|-&lt;br /&gt;
|8:47 &lt;br /&gt;
|That's all in this tutorial. Thanks for watching.  This is Arvind dubbing for the Spoken Tutorial project. Bye.&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>