How can i practice PHP?

Hi iam finished recently my php tutorial, but i think it only covers basics i don’t have any realistic knowledge on PHP.Then I decided to do some practice on basic functions then i cover users authentication, password reset method(email), database (CRUD) functions whatever i learn i think i not yet covered 10% also how can i improve my PHP skill with realistic experience.

Think of something to do, a project, design it and write it. I find that actually having an end goal and figuring out how to write the code for it is far more useful in terms of learning than just looking at tutorials and so on.

5 Likes

My first projects were galleries which were quite good as you had image uploads which needed validation and manipulation. Then displaying the images.

I then moved on to multiple image upload, text input and saving the data to a database; this needed text validation as well. Then displaying by date and subject and also included a google map to show the location.

Anyway just an idea as it covers a lot of different subjects and you can see the results.Of course you have the css as well and you could use some JavaScript for the upload and image sorting.

1 Like

I would suggest reading the entire PHP manual. That’s a good start. Start by reading every function and what they do. Then you’ll cover about 90% of it. The other 10% is for you to test.

I always wont get a internet connection can i get an offline manual. Can u tell me how can i download php manual officially.

I gave up on reading entire books or manuals on PHP, because I found that if I didn’t use something, I would forget it. It just became a case of information overload.

I really think the best way to learn after you have ‘mastered’ the basic syntax and structures is to build a project - maybe something that can be expanded upon as you explore different areas of PHP and research possible solutions.

I started with a set of ‘business tools’ for myself, which can get as large as I want - a CRUD application for storing client information, a to-do list, a task timer, an appointment calendar, document uploads, anything goes.

Every once in a while as I learn, I go back to it and add a feature, or even change the structure such as converting it from procedural to OOP while I was learning that, and then my own little framework. And all the while, I had something that I could use in real life, so the motivation remained to continue building on it.

5 Likes

Why we need to use OOP structure(is any extra security using classes and objects) we can program in procedural only.

I’m not saying that you need to learn OOP, that’s a topic for a totally different thread perhaps. I’m just saying that you can use your ‘practice’ project to practice the different areas of PHP that you are currently learning and then end up with something useful.

You really shouldn’t aim to learn everything about PHP. There’s way too much and it’s just not practical. There are some things in the PHP manual that I bet very few people even know exist and that are used rarely.

You get to a point where you just learn what you need in order to solve a problem that you are currently working on. That way, you will be more likely to remember that skill and use it again. Then you move on to the next problem and maybe have to learn something new about PHP to solve that one.

4 Likes

Of course
http://php.net/docs.php

The only thing missing from downloaded documentation are the “user contributed notes” which at times I have found to be very helpful.

As far as reading and learning the entire documentation, unless you have extraordinary reading speed, comprehension and retention abilities, I fear that goal would end in frustration.

However, I strongly recommend at least skimming through as many “index” pages as you can to get a rough idea about what is available. For example, you may never need to go anywhere near bitwise operators, but if it happens that you ever do, it is better to know they are there rather than writing bloated code to do the same thing that could have been more easily done using them.

After that, as others have said, just start writing code, referring to the documentation often. And yes, having a “project” to work on is a great help. Either something simple, or something that can be broken down into smaller “chunks” will help to keep you from getting overwhelmed and lost.

2 Likes

How about creating your own manual with a database of functions learned? Make a crud system to add functions with a link to the online manual with your own observations/notes. Also create a string search and possibly a results paged output.

1 Like

If you want to study PHP in a full fledged manner then i would prefer the site W3schools.com.
As the site covers all the syllabus under PHP in a simple and understanding way. You can practise the code in the site itself and see what the output is. This site provides you about PHP from basics to advanced level.

No. Do not use w3schools. If you want to learn real PHP, get an up-to-date PHP book or learn it from the official PHP manual.


I also like John’s idea. I suppose it would do the OP some good if he puts his learning to use.

1 Like

Definitely think of a project you would like to do and then code it. Best way to learn for me.

Else work through more tutorials if that’s your thing however I find that most of my learning growth came through building my own projects and solving the problems that came along with it.

Also when you encounter a problem in your project try to solve it yourself and if you cant don’t be shy to find a solution on the internet, this will help you to learn.

2 Likes

Install WAMP or XXAMP on your computer which will emulate a php environment. You can make as many projects on your own computer than way as you want.

That doesn’t help the OP at all. The OP has gone pass installing at this point. Please read the topics more carefully before posting.

If all you want to do is “practice” rather than build actual tools or apps, then maybe you could make a study out of every function.
In other words, depending on what extensions you have installed there might be 1800 - 3000 various functions available, give or take.
Pick a function to learn, give it a quick study, then write some made up tool which makes use of it. This probably sounds crazy but I’m not talking about spending days on a simple little function. I’m saying take a function, look at what it’s for and what arguments it takes and what the output and error conditions are. Then figure out a way to test various inputs and read the outputs and use the function in some way.
Simple functions might only be a 10 or 20 minute study, not talking about a lot of time.

Another way is to study functions by their relationship. For example do the above study and practice but for all string manipulation functions, or all regex functions, or all cache functions, or output capturing functions, etc.
If you hit a larger topic, like studying all the mysqli functions or PDO functions, this could take a while, but other classes, not so much, like playing with json encode and decode.

If all you’re doing is “practice”, then at the least this will give you practice making use of PHP functions and you’ll get a general idea and feeling of how they tend to work, how the outputs tend to work, falsey and truthy values, etc.

If you want to practice in a more real world way, solving actual problems, check out the coding challenges on reddit here: https://www.reddit.com/r/dailyprogrammer/
These are organized in easy, intermediate, and advanced challenges. Many people solve them in various languages like Javascript and Ruby and PHP too.
If you are the obsessive compulsive type, you could go all the back to the challenge #1 on the beginner side and just do every one of them. Store each of your answers in a Git repository or something.
I’ve been doing these challenges, solving them in both Javascript and PHP for practice.

Anyway, good luck!

2 Likes

You have no idea what environment he is working in. It is obvious he doesnt have localhost or he would be using that to practice on or create projects on. You are making assumptions from a paragraph that doesnt warrant them

The Template
Find free some HTML5 template for cms and front end

Setup Dev Environment
xampp will be good fit

figure out witch php version on working 5.6 or 7.0 - 7.1+

if learning basic then go for 5.6
from there on create own sand box for coding
setup bitbucket or github.
and have lot of fun and learning

Install Xampp on local server and start writing PHP codes on any text editor. You can find many tutorials online but the best one is php official site or a book it will help you understand the basics of PHP language.

Procedural is just fine, and you can create lots of simple PHP applications with procedural coding. But for a more complex application, OOP is usually the better way to go. I wish I had learned PHP OOP a lot earlier, because I’m just getting my head around it myself after 12 years of procedural PHP coding. It’s almost like learning a new language, so, if you can do it now you’ll be doing yourself a favor down the line.

I found the Treehouse PHP OOP video tutorials (not free) very helpful, plus you have to do some coding as part of the lesson which helps you retain what you learned. Code Academy is free and requires lots of coding during the lesson, too, but it’s not video.

Once you have a good grasp of PHP code and structure, start a project built with PHP. There’s no better way to learn PHP than creating something from scratch.

5 Likes