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 Basic : 102 Exercises with Solution
- PHP Basic Algorithm: 136 Exercises with Solution
- PHP arrays : 59 Exercises with Solution
- PHP for loop : 38 Exercises with Solution
- PHP functions : 6 Exercises with Solution
- PHP classes : 7 Exercises with Solution
- PHP Regular Expression : 7 Exercises with Solution
- PHP Date : 28 Exercises with Solution
- PHP String : 26 Exercises with Solution
- PHP Math : 12 Exercises with Solution
- PHP JSON : 4 Exercises with Solution
- PHP Searching and Sorting Algorithm : 17 Exercises with Solution
- More to Come !
PHP Challenges :
- PHP Challenges: Part -1 [ 1- 25]
- More to come
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 2021 compared to a year ago:
Rank | Change | Language | Share | Trend |
---|---|---|---|---|
1 | Python | 30.44 % | +1.2 % | |
2 | Java | 16.76 % | -2.0 % | |
3 | Javascript | 8.44 % | +0.3 % | |
4 | C# | 6.53 % | -0.7% | |
5 | ![]() |
C/C++ | 6.33 % | +0.3 % |
6 | ![]() |
PHP | 6.05 % | -0.2 % |
7 | R | 3.87 % | +0.1 % | |
8 | Objective-C | 3.71 % | +1.2 % | |
9 | Swift | 2.14 % | -0.3 % | |
10 | TypeScript | 1.78 % | -0.0 % | |
11 | Matlab | 1.74 % | -0.1 % | |
12 | Kotlin | 1.7 % | +0.0 % | |
13 | ![]() |
Go | 1.33 % | +0.1 % |
14 | ![]() |
VBA | 1.2 % | -0.2 % |
15 | ![]() |
Ruby | 1.12 % | -0.2 % |
16 | ![]() |
Rust | 1.03 % | +0.3 % |
17 | ![]() |
Scala | 0.72 % | -0.3 % |
18 | ![]() |
Visual Basic | 0.69 % | -0.2 % |
19 | ![]() |
Lua | 0.64 % | +0.3 % |
20 | ![]() |
Ada | 0.63 % | +0.3 % |
21 | ![]() |
Dart | 0.56 % | +0.1 % |
22 | ![]() |
Abap | 0.51 % | +0.0 % |
23 | ![]() |
Perl | 0.48 % | -0.1 % |
24 | ![]() |
Julia | 0.38 % | +0.1 % |
25 | ![]() |
Groovy | 0.37 % | -0.1 % |
26 | ![]() |
Cobol | 0.35 % | +0.0 % |
27 | ![]() |
Haskell | 0.27 % | -0.0 % |
28 | Delphi | 0.26 % | +0.0 % |
Source : http://pypl.github.io/PYPL.html
TIOBE Index for January 2021
Jan 2021 | Jan 2020 | Change | Programming Language | Ratings | Change |
---|---|---|---|---|---|
1 | 2 | ![]() |
C | 17.38% | +1.61% |
2 | 1 | ![]() |
Java | 11.96% | -4.93% |
3 | 3 | Python | 11.72% | +2.01% | |
4 | 4 | C++ | 7.56% | +1.99% | |
5 | 5 | C# | 3.95% | -1.40% | |
6 | 6 | Visual Basic | 3.84% | -1.44% | |
7 | 7 | JavaScript | 2.20% | -0.25% | |
8 | 8 | PHP | 1.99% | -0.41% | |
9 | 18 | ![]() |
R | 1.90% | +1.10% |
10 | 23 | ![]() |
Groovy | 1.84% | +1.23% |
11 | 15 | ![]() |
Assembly language | 1.64% | +0.76% |
12 | 10 | ![]() |
SQL | 1.61% | +0.10% |
13 | 9 | ![]() |
Swift | 1.43% | -0.36% |
14 | 14 | Go | 1.41% | +0.51% | |
15 | 11 | ![]() |
Ruby | 1.30% | +0.24% |
16 | 20 | ![]() |
MATLAB | 1.15% | +0.41% |
17 | 19 | ![]() |
Perl | 1.02% | +0.27% |
18 | 13 | ![]() |
Objective-C | 1.00% | +0.07% |
19 | 12 | ![]() |
Delphi/Object Pascal | 0.79% | -0.20% |
20 | 16 | ![]() |
Classic Visual Basic | 0.79% | -0.04% |
Source : https://www.tiobe.com/tiobe-index/
List of Exercises with Solutions :
- HTML CSS Exercises, Practice, Solution
- JavaScript Exercises, Practice, Solution
- jQuery Exercises, Practice, Solution
- jQuery-UI Exercises, Practice, Solution
- CoffeeScript Exercises, Practice, Solution
- Twitter Bootstrap Exercises, Practice, Solution
- C Programming Exercises, Practice, Solution
- C# Sharp Programming Exercises, Practice, Solution
- PHP Exercises, Practice, Solution
- Python Exercises, Practice, Solution
- R Programming Exercises, Practice, Solution
- Java Exercises, Practice, Solution
- SQL Exercises, Practice, Solution
- MySQL Exercises, Practice, Solution
- PostgreSQL Exercises, Practice, Solution
- SQLite Exercises, Practice, Solution
- MongoDB Exercises, Practice, Solution
- Euler Project
[ 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 :
- HTML CSS Exercises, Practice, Solution
- JavaScript Exercises, Practice, Solution
- jQuery Exercises, Practice, Solution
- jQuery-UI Exercises, Practice, Solution
- CoffeeScript Exercises, Practice, Solution
- Twitter Bootstrap Exercises, Practice, Solution
- C Programming Exercises, Practice, Solution
- C# Sharp Programming Exercises, Practice, Solution
- PHP Exercises, Practice, Solution
- Python Exercises, Practice, Solution
- Java Exercises, Practice, Solution
- SQL Exercises, Practice, Solution
- MySQL Exercises, Practice, Solution
- PostgreSQL Exercises, Practice, Solution
- SQLite Exercises, Practice, Solution
- MongoDB Exercises, Practice, Solution
- Euler Project
PHP: Tips of the Day
PHP: How do I install the ext-curl extension with PHP 7?
sudo apt-get install php-curl
This will install a dependency package, which depends on the default php version.
After that restart apache
sudo service apache2 restart
Ref : https://bit.ly/2IX4Hv6
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- React - JavaScript Library
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework