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!
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!
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.
- Clone the repo
git clone https://github.com/kimfucious/phpify.git
- Run the docker-compose command
docker-compose up
- Open your browser to https://localhost
When the party's over you can run:
docker-compose down
- Anagrams: Tests whether or not two strings are anagrams of one another
- Capitalize: Capitalizes the first word in a given string
- Chunk: Breaks a given array into smaller arrays with a given chunk size
- Fibonacci: Uses recursion with a memoization wrapper to get past that pesky O(2^n) performance bugaboo
- MaxChar: Finds the most used character in a string
- Palindrome: Checks whether or not a given string is a palindrome
- Reverse Integer: Reverses an integer as long as it's not too big
- Sorting: Bubble Sort, Merge Sort, & Selection Sort
- Vowels: Counts all the vowels in a given string
Life is good. Enjoy!