Learning Laravel: Composer and The Laravel Installer

I spent years writing Laravel code at UWM but you might have noticed that I almost never wrote anything on this blog about it.  I am hoping to address that here and now.  If you don’t already know, Laravel is a free, open-source PHP web framework, intended for the development of web applications following the …

Continue reading "Learning Laravel: Composer and The Laravel Installer"

PHP function of the day: array_rand()

For day 20 of 21 in the “PHP Function of the day” series, I’m going to look at array_rand().  The function takes a required array and an optional number of random keys to return.  It returns a random key (not the value). Let’s take a look. <?php $names = array(“Joe”,”Jim”,”Sarah”,”Jill”); $numbers = array(1,2,3,4,5,6,7,8,9); $names_rand_keys = array_rand($names,3); $numbers_rand_keys …

Continue reading "PHP function of the day: array_rand()"

PHP function of the day: date_diff()

For day 19 of 21 in the “PHP Function of the day” series, I’m going to look at date_diff(). Let’s take a look. <?php $shoppingDay=date_create(“2020-05-28”); $payDay=date_create(“2020-06-01”); $difference = date_diff($shoppingDay,$payDay); print_r($difference); echo “<br /><br />”.$difference->format(“%R%a days”); ?>   See the output   As you an see, this calculates the difference between two dates (something that could be pretty …

Continue reading "PHP function of the day: date_diff()"

PHP function of the day: array_flip()

For day 15 of 21 in the “PHP Function of the day” series, I’m going to look at array_flip(). As you might guess, this function “flips” the array so that the key is the value and the value is the key. Let’s take a look. <?php $joe = array(“fname”=>”Joe”,”lname”=>”Steinbring”,”website”=>”jws.dev”); print_r($joe); echo(“<br />”); print_r(array_flip($joe)); echo(“<br /><br />”); $foods …

Continue reading "PHP function of the day: array_flip()"