PHP-Koans
Learn PHP by fixing failing tests. Designed as a series of successive problems where you type missing pieces of code to learn the basics all the way to advanced concepts with PHP. When you're finished you'll also have an entire library of code samples to reference as well.
Designed to teach the basics of PHP and inspired by the absolutely awesome http://www.rubykoans.com Requires PHP 5.3 or greater.
#Prerequisites
- Install PHP 5.3 or higher and the ability to run the
php
command from the command line. - Install Composer from https://getcomposer.org
Getting Started
- Checkout or fork this repository and make sure you're on the master branch.
- Open up a terminal run
composer install
from the checked out project to install dependencies. - Run
php koans.php
from a terminal and follow the instructions. Re run this command as you solve the problems to see your progress.
#Exercises
##Chapter 1 - Variables
- Declaration - [S]
- Integers - [S]
- Floats - [S]
- Booleans - [S]
- Null - [S]
- Casting - [S]
- Assignment - [S]
- Constants - [S]
##Chapter 2 - Math
- Addition - [S]
- Subtraction - [S]
- Multiplication - [S]
- Division - [S]
- Modulus - [S]
- Rounding Naturally - [S]
- Rounding Up and Down - [S]
- Increment and Decrement - [S]
##Chapter 3 - Strings
- Concatenation - [S]
- Substitution - [S]
- Replacement - [S]
- Length - [S]
- Single Characters - [S]
- Substrings - [S]
- Changing Case - [S]
- Searching - [S]
#Status I'm building this out as a side project when I have time so the exercises don't cover all of the concepts they should yet, but everything in the master branch will always be complete. If you get stuck you can also check the solutions branch to see the pieces of missing code to fix the problems.
#Feedback If you found these helpful, spot a bug, or want to help contribute please contact me.