What are Arrays Used for in PHP

today we're going to continue talking about a race inside PHP and the reason I want to do that even though we talked about a race in the past is because for the next couple episodes going to do more advanced stuff with a raise so before we do that I'd like to spend this one episode just briefly talking about when exactly use a race inside a website as you guys can see i have a website right in front of me here and inside this site or these inside this index page i have a variable called person which is equal to Daniel and have a variable called people which is equal to an array now the basic idea behind array is that if I have one piece of data for example Daniel which is a name that is equal to a variable then we can easily just do a regular you know value as Daniel but let's say you have a lot of values are a lot of data that needs to go into one variable then we can use a race now beneath me I have a variable called people which is equal to an array that has daniel Jane and John if i want to write this on the website i could go ahead and echo variable people brackets and then say we want the first piece of data which is Daniel so we come from 0 1 2 3 4 this is very basically talked about it before typical refers to web site you can see I get Daniel now the most typical place you might be using this inside a website because I've heard people ask me before you know what exactly to use a raise for because we haven't actually used to raise and one repeat this exercise as we've done in this channel now one of the reasons we might want to use in a rare inside website is when we have a lot of data that needs to go into one variable now write down here do i only have three different pieces of data which could easily go into three different variables i would just say name number one number two number three but when we have a lot of data for example a hundred or maybe 200 names instead of having to create 100 or 200 variables such equal to a name it's much easier just to put them inside an array now you might be asking one can we actually do that and when do we actually need to use that inside a website in my case the reason that i use it most often is when I have to spit out data from a database now I like to use something called object oriented PHP programming which is not procedural programming which is what we've been learning so far the basic idea behind procedural and object-oriented is that inside a file like the front page that i have here when I need to use PHP i just simply create the PSP code for the stuff that i need to use right now when you do object oriented PHP you create all the functions and everything on the side inside a separate document and then you call in those functions whenever you need to use them so you don't have to recreate them all over again every time you need to use them inside the file now if that doesn't really make sense to you just go ahead and ignore what I just said but the basic idea here is that when I have a lot of data from a database and I need to spit it out inside a website when it comes to object onto PSP one of the solutions to do that is by using a race so we're going to talk about also in one of the next episodes how to take data from a database and put it inside a race so we can actually spit it out inside a website because they will get useful when you do actually need to do object onto PSP at some point future when you actually get to that point so that's the basic idea behind a race at least when i use a raise that's what I used for so for the next episode we'll be talking about how to take an empty array which is just basically an array without any kind of data in it and how to insert data after you created the array so if you guys enjoyed this episode and i'll see you guys next time