Problem This is my working template file which I manually edit to create new properly formatted webpages for my personal […]
Tag: php
Shuffle array elements by rearranging the key value associations
Problem PHP’s shuffle() function destroys the array keys, so I decided to write a shuffle function that doesn’t do that […]
Fields are required, except if all fields are empty
Problem I have a group of four inputs, the first three are required, the fourth is optional. $fieldA $fieldB $fieldC […]
PHP code that chooses between multiple HTML banners
Problem In the snippet below, I’m creating a banner for my website. If I change the variable in the html […]
Setting configuration arrays
Problem I’ve created a website that displays weather and currency rates for London and New York. The following is an […]
Forgotten password / password reset
Problem I have hand-coded a forgotten-password reset system. I am apprehensive about security issues/vulnerabilities. What part of this can be […]
PDO wrapper class for database
Problem I have my PDO Wrapper class and would love to get some more tips/opinions about what you think. This […]
Inserting data into database
Problem I started learning PHP and MySQL, was using MySQL_ functions. Then I learned they are deprecated, had to choose […]
Checking if naughts or crosses win in Tic Tac Toe
Problem I am working on a coding challenge for Tic Tac Toe. I am calculating the results and inserting them […]
Test Driven Development Roman Numerals php
Problem I just learned about Test Driven Development on a podcast yesterday. So I decided to try it out today […]