Learn how to create and access PHP multidimensional arrays

multidimensional-array is an array element which can contain another array as a value, which in turn can hold other arrays as well. Each location in the array can hold another array. multidimensional-arrays can be two-dimensional or three-dimensional array. Example, We have this following user’s table, which holds our user’s information, their Usernames, E-mails and Countries of origin. Username E-mail Country Jordan jordan@yahoo.com USA Beckham beckham@gmail.com UK Uhurukenyata uhuru@gv.ke Kenya Now we need to represent our table in array using PHP. Example ⇓ multidimensional-arrays We will first create an array of users, which is two-dimensional.       <!DOCTYPE html>  <html>    … Continue reading Learn how to create and access PHP multidimensional arrays

PHP Anonymous Functions

Anonymous Functions have no given function name unlike normal functions, this is also known as closures. You will mostly use Anonymous Functions in other php functions as parameters, (callback parameters) Some PHP functions use a function as parameter or as callback function to do part of their work. Let us see show cases here the usort() function sorts an array by values using a user-defined comparison function. Forexample, the usort() function takes two parameters , the array to be sorted and a callable $value_compare_func respectively. This second paramter (the user defined comparison function) gives you the possibilitiy to tell the … Continue reading PHP Anonymous Functions