 seven years. So my topic for today is 10 awesome things in PHP. It's a very light topic. There are many useful PHP functions. So as a developer, it is not necessary that we must know all the functions available in PHP. So I've randomly picked 10 out of them. Some of you must be familiar with it, but there are a few others who have just started their careers in PHP or who haven't come across it. So I'll dive into the first function. First is check DNS RR. I'm not sure how many of you have heard of it. Does anybody have used it before? Okay. Okay, this function basically helps to check the DNS records of the host name or the IP address that is provided into the function. So it is a network type function. It's available in PHP 4, 5, and 7. So it takes in two parameters. One is a host and the other is a type. Host is the IP address or the host name itself, and type is the DNS type. So if you didn't pass any DNS type by default, it takes MX. That's a mail exchange type. So it returns true if the record exists. Otherwise, it will return false. So here's a simple example. So this function does a partial validation of an email address. So what it does is that it will extract the domain name from the email and it pass it to the check DNS RR function. If the domain exists, it will return true. Otherwise, it will return false. So this will help you to find out if the host name exists. I mean the DNS exists. The domain exists. You can check the validity of the email. My next function is extract. Extract is used to import the variable into the current symbol table. It's a very cool function. You can reduce the steps while programming. It's widely used in WordPress if I'm not wrong. It's an array type function. It is available in PHP 4, 5, and 7. So it takes in three parameters. One is an array. Array is an associative array. If you pass a numerically index array, it may not produce any output unless you use some extract flags with it. Flags are used to treat the invalid or numeric keys and collisions. Next is prefix. Prefix is, if you didn't pass anything, it is null. It is used with certain flags. It returns a number of variables that is imported to the current symbol table. Here's an example. This is an associative array with my first name and my last name. So I'm extracting my first name and last name using the array key as the variables. Is that clear? Next is usort. Usort is used for sorting an array using a user-defined comparison function. So the comparison function must return an integer which is less than, equal to, or greater than 0 if the first argument is less than or equal to or greater than the second one. It's again another array function. So it's available in PHP 4, 5, and 7. So it takes in two parameters. One is array. That is an input array. And second is the user-defined function itself, the comparison function. So it returns true on success, false on failure. So here's an example. So this example consists of a list of people's first name, last name, and their age. So I've defined a compare last name function. So basically what the function does is that it compels the, it sorts the array based on their last name in alphabetical order. So it will return a sorted array, sorted array alphabetically based on their last name. So this is the output. I've formatted it for your better understanding. Next is function getArts. This is a very common function that is used. It is used to return the list of arguments in PHP in the function. So it's a function handling function. It is available in PHP 4, 5, and 7. This is a syntax function getArts. It returns the list of arguments in the function. So PHP takes, it helps to retrieve them, it takes arbitrary number of arguments. So here's a simple function that accepts arbitrary number of arguments. So it uses function getArts to retrieve the arguments and I've looped the arguments to print them. So in the first time when I call it, I just pass one argument. So it prints out the one argument and the next time I've passed three arguments, it prints all the three arguments. Next is getEnv. GetEnv is a PSP options or info function. It's used to get the value of the environment variable. It's used in PHP 4, 5, and 7. So the parameter is just a variable name. It returns a value of the environment variable or false if the environment variable doesn't exist. So here's a simple example. So I'm fetching the remote address using getEnv. Alternatively, you can use a super global like dollar underscore server or dollar underscore env. It basically serves the same purpose. Next is globe. Globe is used to locate the path name that is matching a particular pattern. It's a file system handling function. It is available in PHP 4.3 and greater. So it takes in two parameters. One is a pattern and the other is a flag. Pattern is a pattern of whatever the pattern is. And flag is optional. There are many flags that can be used. You can refer the PHP manual for that. So the return value will be the array of the match files. And an empty array will be written if there's no file found or it will return false if there's in case of any error. So here's a simple function, example, which retrieves all the files that matches this particular pattern. So it will list the file names and the file size. So it can also take multiple pattern. So I have demonstrated another example which can take the multiple file. So this is the case where you might have to use a flag. So globe underscore brace is a flag which expands this brace to search for these two patterns. Next is error get last. This is also very common function. So this is used to get the last occurred error. It's an error handling function. It is available in PHP 5.2 and greater. It returns an associative array returning the last error. So it returns null if there hasn't been an error yet. So the array that it returns will have the type, message, line, and the file as a key. So if there's any, if the error is with the function in the message, it will state the function name itself. Next is serialize. Serialize is a PHP native function. It generates a storeable representation of a value. These days I think JSON is very popular. So to add support, JSON encode and JSON decode is added into 5.2 and greater. So when you pass a value into serialize, you must properly sanitize it because when you un-serialize it, there are chances for security vulnerabilities. So in PHP 7, I think they have introduced allowed classes to prevent this. So it's a variable handling function. It's available in PHP 4, 5, and 7. So it returns a string containing byte stream representation of a value. So here's an example. Basically I've just passed an array and it will retrieve the string which is byte stream representation. Next is check date. This is a date time function. This is used to validate a Gregorian date. Gregorian date is a Western date. So it is PHP, it is available in PHP 4, 5, and 7. It takes in three parameters, the month, day, and year. It also validates the leap year. So it returns truth, the date is valid, otherwise it will return false, and you have to define the parameters correctly, otherwise it may not return the proper result. So here's an example. Here I've passed the date June, June 31st, 2016, and it will return false because June has only 30 days. And I've checked if this year is a leap year. So I've passed 29th February. So it will return true. This is the last one, Levenstein. Levenstein is used to calculate the Levenstein distance between two strings. So it's a string function. Levenstein distance is the number of the minimum characters that has to be inserted, deleted, or replaced to match the first string to the second string. So it's a string function. It is available in PHP 4.1 and greater. So it takes in two parameters, string one and string two. So the function will return the two, return the Levenstein distance between the two strings. So here's an example. First string is carrot, second string is carrot with an additional r and t. So when you pass these two strings into the function, it will generally return the Levenstein distance between these two strings. Okay, so that's it. You can reach me at Twitter, Brita underscore Alex, and my Gmail address, Brita dot Alex at Gmail dot com. Thank you.