How I can learn all php functions and

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.

Thanks.

you don’t need to learn them as long as you know how to look them up in the PHP Manual.

for this you should study application design articles/tutorials.

2 Likes

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.

2 Likes

Do you want me to learn functions one by one, because it is so big.

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.

1 Like

Namaste, I got it!

1 Like

I believe every function has a return value otherwise it is classed as a method.

Always test a function’s result rather than assume success because assume makes an ass…

1 Like

nope (e.g. echo does not have a return value and that’s definitely not a method). methods are functions tacked to classes.

1 Like

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.

It’s not a function either. It is, according to the manual, a language construct.

1 Like

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.

Quote from a quick Google search.

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)

I didn’t thnik this way, thanks man:)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.