Skip to content

kimfucious/phpify

Repository files navigation

PHPify

A live demo of this codebase can be found at https://phpify-eb9fd.appspot.com.

I made this to remind myself that PHP is not WordPress and that I've forgotten more PHP than I remember.

Amazingly, PHP is, to-date, the 4th most popular programming language in the world!

NyanCat

Doing this, I was very happy to remember that PHP has great documentation. And it's really hard not to find a solution to whatever problem you come across on Uncle Google.

I intentionally did not spend a lot of time on the UI, it's just a Bootswatch take on Bootstrap 4. There's very minimal CSS on top of that.

Also, there's zero JavaScript by design.

Normally, I'd write a bunch of test cases, and use those as I have in other coding exercise projects, but I have completely forgotten how PHPUnit works. I may come back around and fill in the blanks.

More challenges to come!

Usage

This repo is "Dockerized" in that you can clone it and launch the whole kit and kaboodle without having to install and configure Apache or PHP on your local machine:

☝️ You will need to have Docker on your local machine to do any of the below. Go here, if you're not already good to go on that front.

  1. Clone the repo
git clone https://github.com/kimfucious/phpify.git
  1. Run the docker-compose command
docker-compose up
  1. Open your browser to http://localhost

When the party's over you can run:

docker-compose down

Exercises

  1. Anagrams: Tests whether or not two strings are anagrams of one another
  2. Capitalize: Capitalizes the first word in a given string
  3. Chunk: Breaks a given array into smaller arrays with a given chunk size
  4. Fibonacci: Uses recursion with a memoization wrapper to get past that pesky O(2^n) performance bugaboo
  5. MaxChar: Finds the most used character in a string
  6. Palindrome: Checks whether or not a given string is a palindrome
  7. Reverse Integer: Reverses an integer as long as it's not too big
  8. Sorting: Bubble Sort, Merge Sort, & Selection Sort
  9. Vowels: Counts all the vowels in a given string

Life is good. Enjoy!

Releases

No releases published

Packages

No packages published

Languages