PHP

Playing With AI

Playing with AI and Learning to Keep It Simple, Silly Yesterday I was playing with AI in the evening and I asked it to help me write a function that would detect whether an array item was a photo or a video. I told the AI, this is a photo array item, and this is a video array item. I want the photo array item to display the img src code and for the video item to be displayed with video src code.

From Instagram Archive to PHP Website

Three years ago I stopped using Instagram because I was tired of seeing influencers and adverts rather than by the people I chose to follow. The cherry on the cake, that pushed me to dump Instagram is when they changed the location of the Post button from the left corner to the top right and changed the default from photo to story. For ten years or more I used instagram and shared photos, and I enjoyed capturing at least an image or two every single day.

Laravel and Context

There is value in studying Laravel and context. By this I mean that over a year ago I wanted to study Angular but after feeling lost in Javascript I decided to take a step back, to study JavaScript. I studied two or more courses over a period of months. I could have followed a single course and claimed that I knew and understood JavaScript but that would have been misleading.

Laravel and Chirper

Today I used Laravel to code a Twitter clone called Chirper via the tutorial you can find here. The tutorial took about two hours before I got the notifications section of the tutorial. The tutorial is easy to follow and with my contextual knowledge I was able to write most of the code with a minimum of errors. The tutorial follows the CRUD model, Create, read, update delete, and adds in notifications for good measure.

Learning About Laravel and PHP

Today I started to follow a course where someone turns a static html page into a Laravel blog. I experimented with home.blade and one or two other features and I got two pages to load, and the login to work, without more than that. What makes today’s learning and experimenting interesting is that the time I spent creating PHP arrays for my website content is now easy to transfer to json files for use with dynamic websites.

Conservation and PHP

Today I have struggled with PHP. I struggled because I want to recreate the same table using loops with PHP as I did formatting with HTML. If I wasn’t up for a challenge I would let PHP loops format it according the default and I’d be done. In the end I did get the table to display as I wanted but not using for loops. I created a table page, laid it out using the data file I’ve been using for this section, and then using include to add that content where I wanted it to be on the page.

A Rainy Day Without Walking

Today the weather app said that it would start raining at 1500 so I didn’t go out for a walk. In the end the rain started at around 1630 or even later. I could have gone for a walk and I could have come back dry or almost dry. For years I went for walks almost everyday, whatever the weather conditions. I grew tired of the habit. I have had this habit for five years or more, three of which have been during the pandemic.

A Shift to PHP

PHP has been around for decades but I learned of a way to experiment with it easily recently so that is why I am playing with it now. The main page is php as is my first “blog” although it was part of a column for the student newspaper, that I converted to an electronic format and published frequently. I tried to keep Surfing the World Wide Waves looking as it had back in the day.

PHP from the Command Line

Recently I learned that PHP has a built in server. You don’t need xampp or any of the other solutions. All you need is terminal open, have the current directory be the one with the PHP files you want to serve and type: “php -S localhost:8000” This might sound obvious to some but it took years for me to come across this. When you have to install xampp or other solutions you need to dedicate HD space, run the servers and more.

Learning To Code By Building CMSs

It’s easy to use Facebook or other CMS every day without thinking about how the code works. This summer I have coded two CMS using Linkedin Learning. One of these CMS was running with PHP and MySQL and the other was running with Ruby On Rails and MySQL. The PHP CMS In the process I learned how to install MySQL, how to get MySQL and PHP to talk to each other.