w3resource
w3resource logo
Java Programming Exercises

PHP Exercises, Practice, Solution

What is PHP?

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with PHP.

Hope, these exercises help you to improve your PHP coding skills. Currently, following sections are available, we are working hard to add more exercises. Happy Coding!

Note: It's fine if you are playing around with PHP codes with the help of an online PHP editor, to enjoy a full-fledged PHP environment (since online editors have several caveats, e.g. embedding PHP within HTML) up and running on your own machine is much better of an option to learn PHP. Please read our installing PHP on Windows and Linux if you are unfamiliar to PHP installation.

List of PHP Exercises :

PHP Challenges :

Note : You may accomplish the same task (solution of the exercises) in various ways, therefore the ways described here are not the only ways to do stuff. Rather, it would be great, if this helps you anyway to choose your own methods.

Popularity of Programming Language
Worldwide, Jan 2018 compared to a year ago:

Rank Change Language Share Trend
1 Java 22.55 % -1.1 %
2 Python 21.3 % +5.6 %
3 PHP 8.53 % -1.8 %
4 up arrow Javascript 8.49 % +0.4 %
5 down arrow C# 8.06 % -0.6 %
6 C 6.51 % -1.4 %
7 up arrow R 4.23 % +0.5 %
8 down arrow Objective-C 3.86 % -1.2 %
9 Swift 3.09 % -0.4%
10 Matlab 2.34 % -0.5 %
11 Ruby 1.8 % -0.4 %
12 up arrow TypeScript 1.47 % +0.5 %
13 VBA 1.46 % +0.0 %
14 down arrow Visual Basic 1.3 % -0.3 %
15 down arrow Scala 1.24 % +0.1 %
16 up arrow Kotlin 0.84 % +0.7 %
17 down arrow Perl 0.81 % -0.1 %
18 Go 0.75 % +0.2 %
19 down arrow lua 0.36 % -0.2 %
20 up arrow Rust 0.35 % +0.1 %
21 down arrow Delphi 0.32 % -0.1 %
22 down arrow Haskell 0.32 % -0.0 %

Source : http://pypl.github.io/PYPL.html

TIOBE Index for January 2018

Jan 2018 Jan 2017 Change Programming Language Ratings Change
1 1 Java 14.215% -3.06%
2 2 C 11.037% +1.69%
3 3 C++ 5.603% -0.70%
4 5 up arrow Python 4.678% +1.21%
5 4 down arrow C# 3.754% -0.29%
6 7 up arrow JavaScript 3.465% +0.62%
7 6 down arrow Visual Basic.NET 3.261% +0.30%
8 16 up arrow R 2.549% +0.76%
9 10 up arrow PHP 2.532% -0.03%
10 8 down arrow Perl 2.419% -0.33%
11 12 up arrow Ruby 2.377% +0.45%
12 14 up arrow Swift 2.377% +0.45%
13 11 down arrow Delphi/Object Pascal 2.377% -0.18%
14 15 up arrow Visual Basic 2.314% +0.40%
15 9 down arrow Assembly language 2.056% -0.65%
16 18 up arrow Objective-C 1.860% +0.24%
17 23 up arrow Scratch 1.740% +0.58%
18 19 up arrow MATLAB 1.653% +0.07%
19 13 down arrow Go 1.569% -0.76%
20 20 down arrow PL/SQL 1.429% -0.11%

Source : https://www.tiobe.com/tiobe-index/

List of Exercises with Solutions :

[ Want to contribute to PHP exercises? Send your code (attached with a .zip file) to us at w3resource[at]yahoo[dot]com. Please avoid copyrighted materials.]

List of Exercises with Solutions :