Follow:  Follow PHPExercises on Twitter  Follow us on Facebook

News

Comments Closed, No Site Membership

In the past, this site allowed comments on exercises. In comments, people could ask for help, propose alternate solutions, and point out problems. However, the site has not received a new comment in the last six months. Since the only reason for site membership was posting comments, that has also been closed down. Closing comments and membership makes this pro bono site easier to manage. If you want to comment, try the Facebook link above. People have posted questions and received answers there. And the contact form remains available for site issues.

Beginner to Intermediate PHP Exercises

Exercises, not Tutorials

The Web is full of excellent PHP tutorials. PHP exercises? Not so much, although more now than when this site first launched. Choose one from the menu on the left (or down below if you're on mobile), and get started!

How It Works

Come here to test your PHP knowledge by writing scripts as requested. When you are ready, click the button to see the PHP answer script. The answer script output is also available. If you need tutorials, check out one of the PHP tutorial sites listed on the Resources page, then come back and try out what you learned!

The PHP programming exercises progress from the simplest scripts ("Hello world!") to more complex. More difficult requests build on skills included in earlier ones. If you jump ahead and find yourself stuck, go back one or two. Be sure to read the comments in the answer script for some explanation. If you find that a different approach gets the same results, great! Just be sure you understand the PHP syntax the problem was designed to test.

What You'll Need

We assume that if you are looking for PHP exercises, you already have a server to practice with. If not, check out Your Setup for some tips on getting started.