 Okay, continuing with our PHP tutorials here and once again this one's going to just be a step further from what we've been going through here. I have created a new names list, so our original names.list has some people's names. If I go to the new names list, I put some last names in there. So what we're going to do is we're going to search or grep through the file and look for matches. So we can match people and in this case we'll be looking for people with the same last name. So we're going to do, I'm going to call it grep.php. And then I'm going to say PHP tags here. And by the way once again this is part of a series so be sure to look for the annotation that I hopefully put up on the screen that will lead you to the playlist that has all the videos because this is video number four in this playlist. And 99% of it is review. So just like in the previous tutorials we are going to create an array that looks towards a file. In this case it's going to be names underscore two dot list. So we're creating an array and each line in the text file is an item in the array. And then we're going to create a for loop. In this case it's a for each loop. So for each item in our lines array, we're going to create a variable called name. And then just like the other tutorials we will just do a echo, dollar sign, name and a line break. But we don't want to view all the names in this case. We want to view the just lines that match a particular string that we give it. So real quick here let's bring up our names list and we got a few people here with the same last name of Gilmore. So we're going to go Preg underscore grep and then inside parentheses and then we're going to use a semi colon to close the command. And we are going to say within here what we are looking for and I'll just paste in the name Gilmore there. Make sure that you have it case sensitive in this case because 99% sure it does make a difference. And we're going to say lines. So basically we are going to grep or Preg grep for this string right here. Within this array. Now that will run that command but we need to put it somewhere and in this case I am just going to replace our original array. You could create a new array but I'm just going to say lines and replace it because I know that in this case I'm not going to use the original array anymore. But all depends on what you're doing with your scripts. If you were to create a new array here you would replace this here with the array you just created. So I'll save that and if I've done everything properly I'll go back and I will refresh this and there's my grep.php. I'll click that and you can see that it's narrowed our list down to four names of people with the same last name. And that's pretty much it for this tutorial. But of course I'll give you another example. We'll go in here and let's say we just want people named Richard. I'll say Richard save it refresh and there's only one person named in the list named Richard. And I am going to double check but I'm 99.99% sure that is most likely case sensitive which it is. So if I did a lower case R here that it will not find the Richard with the capital R. And that's something for a future tutorial possibly. So I thank you for watching this tutorial and I hope that you're enjoying my PHP tutorials. Once again this is part of a series. There should be an annotation to a playlist. And this is just leading up just use quick little tips to prepare us for creating full blown applications with jQuery, JavaScript, HTML and CSS as the front end and some cases using PHP to go through stuff on the server side. So I just wanted to catch you guys up. Plus PHP is very commonly used so it doesn't hurt to know some of it. So thank you for watching and I hope that you have a great day.