How I can learn all php functions and also to write better code for ex:
In this question I was suggested to use move_uploaded_file function by @chorn to get the result. Exactly how we can learn these all functions and also give me suggestions, on how to remember them.
There are too many PHP functions and too many of them have similar uses for you to even try to learn all of them. And you won’t remember all of them and their purposes unless you use them all the time.
I would just keep php.net and Google close at hand, and learn from the experienced php coders as to which function is best in which situation. That is one of the perks of having something like SitePoint where you can ask these questions and take the advice and suggestions of the developers.
The trick is not to know all the answers, but to know where to find them when you need them.
No, we are saying that you shouldn’t learn them all. When someone advises you to use a certain function in a certain situation, look that function up in the PHP Manual, read about its uses and try to understand the code examples that are provided there for you.
Gradually you will expand your knowledge base and have a better idea what to use, and when to use it.
if you think about doing something, try to devide your task in small pieces. for these pieces you mosty can rely on functions that are for a specific type, like array, string, integer etc. Than you can lookup the manual like php.net/str_ and get a suggested list of functions. While many functions are counterintuitive in parameter order, they are more precise when it comes to naming - strpos for string-position etc.
Php 7 has introduced several new features which will not only help in writing “better code” but also make scripts run faster. There are numerous Php 7 articles available and also tutorials.
An easy way to tell the difference between a Procedure and a Function is to look at the names: Functions are fun: if you would call them, they would return a value’ Procedures aren’t fun: if you call them they don’t return any value. (these are known as sub in Visual Basic)