 Okay, if you've watched my first two tutorials in this series on PHP, which by the way, hopefully if I didn't forget, there should be an annotation to the playlist which will have all the videos in it, which will be added once to twice a week, hopefully be adding videos to it. This is going to be kind of boring for you, because it's 99% review just like last time when we sorted text files and the first tutorial we read them, basically we added one thing and we're kind of doing the same thing, but reviewing is good, so I'm going to try to review really quick here, okay? So once again, as always, a list here, we've got the PHP files we've made and then we also have a text file that I'll look at out here called names. You can see up here our sort PHP, right now we have it reverse sort, so it's sorting them in reverse alphanumeric order. Today we're going to shuffle that file. So right here I'm going to create a file, I'll call it shuffle.php, we're going to create our PHP tags here, and I'm going to create an array called lines, going to call the function file and pass it the name of the file that we want to read, which is list, names.list, and then for each in our array here, so we're doing a for loop, that's why we have the squiggly braces there, curly braces, squiggly brackets, whatever you want to call them, dollar sign lines, which is our array as dollar sign name, and then we will echo dollar sign name and line break. So that's how we read a file, so that's all review at this point. Last time we did a sort and a reverse sort function passing it our array, this time we are going to say shuffle dollar sign lines, giving it our array. So basically we're saying read this file, so file, this file, and put it into an array called lines, and then we're going to say look at each line in this array, each item in this array, and we're going to shuffle it. So now it's all mixed up, and then we're going to read it line by line and output each thing on each line. So let's save that, so we go back and you can see we have a file called shuffle.php here, I'm going to click that, oh see I got an error here and right away I can look at my code and know what it is without even reading it, but it does tell you that the problem is on line 7 and it tells you what the problem is and basically as I stated in earlier tutorials, and each command with a semicolon. Okay, so I did that, saved it, refresh, and there we go, we have our list of names in reverse order, if we refresh you can see each time it will shuffle them and display them in a different order, a random order if you will kind of sort of. So that is how you shuffle text files, each line in the text file, so I'm just hitting F5 to refresh here, you can click the refresh button, so if you ever need to grab some random name from a file you can do that and you'll have them in a random order, so that is it, thank you for watching tutorial, sorry if it was a little boring, probably should just add this into the last tutorial but I didn't think about it until after I finished recording, so shuffling, text files, there you go, please visit filmsbychrist.com for more tutorials like these and on other programming languages, once again this is part of a series on PHP that I'm doing, there should be an annotation to the playlist and once we get through some just basic PHP stuff and we finish up on the jQuery tutorials, then we're going to start making applications that will later on package into different packages for different operating systems, so I thank you for watching and please visit filmsbychrist.com, there should be a link in the description, have a great day.