Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Learning PHP functions

Featured Replies

I've been learning Javascript for around a month and for the sake of variety I've started to learn some PHP. I've looked at the array and string chapters and one thing that is striking is the number of built in functions. Someone helped me to clarify what functions are in another post for JS and I'm going study them a little futher.

It appears that PHP has over 1000 built in functions. Now I don't know about anybody else but there is no way I will be able to remember all those functions. Going through the pages it's like the writer is pulling out convenient functions out of a magic hat. As far as I can tell I'm sure I won't need all the functions mentioned in the text book but I will need some of them depending on what I'm doing. Arrays alone seem to have an endless amount of functions but the question is which ones to use. It would not be so bad if I knew what the functions were then at least I could select the ones I need to use but my problem is I don't even know what functions there are in built. Even If I had a list of over 1000 functions trying shift through it all would be a nightmare.

How do the PHP developers tackle this? What is the solution?

I'm thinking that functions must be divided in categories so you might have array functions, string functions, and mail functions and so on. So, instead of memorising the functions I could memorise the categories and note down what each category does. Then if I have an overview of those categories I could then see what functions within those categories I would need. Would this be a workable way of doing things and if so is there a PHP functions guide that will give me such a thing?

You should read my post I've made in a related topic yesterday: http://www.webdesignerforum.co.uk/topic/72599-php-or-aspnet/?p=456044


You're approaching this wrong. You're trying to memorise the PHP syntax/language, and that's not going to happen. Even if you did learn 1000 PHP functions off by heart, the fact that you're memorising them tells me that you don't understand the fundamentals of why they exist. You need to understand the concepts behind Object Oriented Programming (OOP), and that will lead into a knowledge base that will lend itself to you picking up languages in a matter of minutes/hours.


I've built some fairly large, successful web applications using PHP, and I sure as hell don't know all the PHP functions I used. I use the PHP docs every few minutes when coding, to remind myself of syntax, or even find new functions/methods.


I've also built Android applications (Java/XML), large Javascript apps, and dabbled with ASP.net. The reason I can just pick up these languages is because I have a fundamental understanding of OOP, albeit fairly basic, and I got that through researching theory and applying concepts to small Java examples at University.


You seem to be concerned about 'functions', which concerns me as that word tends to refer to the procedural programming style. Most high-level languages you will use these days are object-oriented, meaning you have objects and methods, as opposed to just a mass of functions.


I hope that above helps you to take a step back and see the bigger picture. You need to learn to program; you don't need to memorise PHP.

I remember thinking like you, and all that happened is that i felt overwhelmed, it wasnt a helpful feeling and it delayed the position i am now, which i like to think is a stage up from where you are.

As mentioned above by andy9l learning the programming syntax of each language and general programming fundamentals is the way to go.

Personally if your learning PHP, i would recommend you learn mysql at the same time(or just SQL), because php is pretty much a side server language.

 

If i was teaching someone
SQL

JAVASCRIPT

PHP

(AJAX which can combine all three above)

JAVA

PHP OOP

I think this might the easiest order to learn

 

anyways back on point once you know what your doing in terms of programming basics and the first of these three languages can work together to make something really nice,
I recommend a user supplied information, php calendar with java-script functionality

P.s once your working a one project or more http://www.w3schools.com/php/ and http://php.net are your best friends, to learn each function that you need as you go along and use or find better solutions to old problems reference back to them to get some insights..

 

P.ss If you can master that try AJAX

  • Author

 

You should read my post I've made in a related topic yesterday: http://www.webdesignerforum.co.uk/topic/72599-php-or-aspnet/?p=456044
You're approaching this wrong. You're trying to memorise the PHP syntax/language, and that's not going to happen. Even if you did learn 1000 PHP functions off by heart, the fact that you're memorising them tells me that you don't understand the fundamentals of why they exist. You need to understand the concepts behind Object Oriented Programming (OOP), and that will lead into a knowledge base that will lend itself to you picking up languages in a matter of minutes/hours.
I've built some fairly large, successful web applications using PHP, and I sure as hell don't know all the PHP functions I used. I use the PHP docs every few minutes when coding, to remind myself of syntax, or even find new functions/methods.
I've also built Android applications (Java/XML), large Javascript apps, and dabbled with ASP.net. The reason I can just pick up these languages is because I have a fundamental understanding of OOP, albeit fairly basic, and I got that through researching theory and applying concepts to small Java examples at University.
You seem to be concerned about 'functions', which concerns me as that word tends to refer to the procedural programming style. Most high-level languages you will use these days are object-oriented, meaning you have objects and methods, as opposed to just a mass of functions.
I hope that above helps you to take a step back and see the bigger picture. You need to learn to program; you don't need to memorise PHP.

 

 

I think what you have described is how I feel. I feel like I'm learning a few bits here and there but not fully grapsing the fundementals of programming. The PHP book I have has a section on OOP so do you think I should skip the early chapters and focus on that?

 

Or do you think I should leave aside PHP for the moment and pick up a book dedicated to the fundementals/basic concepts of (oop) programming? If so could you recommend be a good beginners book on programming?

 

Thanks for you comments.

  • Author

I found a site and it said if you understand these basic programming concepts you can pick up other languages. Is this what you meant when you said to grips with the concepts of OOP. Here is the list:

 

Section 1- Algorithms and Errors
Section 2- Variables and Conditionals
Section 3- Loops
Section 4- Arrays
Section 5- Functions
Section 6- Objects

The Best way to learn those concepts is to pick a language and learn from beginning to end.. I dont mean memorize functions like you mention in the question.. But OOP php is not the first step, there should be no skipping ahead if you want to learn...

Here are two books

javascripts: the definitive guide O'reilly

 

PHP Cookbook O'reilly

The Best way to learn those concepts is to pick a language and learn from beginning to end.. I dont mean memorize functions like you mention in the question.. But OOP php is not the first step, there should be no skipping ahead if you want to learn...

 

Here are two books

 

javascripts: the definitive guide O'reilly

 

PHP Cookbook O'reilly

I agree with the above for example if you don't understand the basics such as variables, what data types are etc... skipping to OOP is going to have u completely lost personally what i did to learn PHP was build a forum from scratch by copying code in a book. Then once i finished it i attempted to repeat building the forum by my self using the book just as a reference if i needed it.

  • Author

Just to give you guys an update. I took on board what you said and I checked out a book dedicated to teaching OOP. Here is part of the description:

 

Object-oriented programming (OOP) is the foundation of modern programming languages, including C++, Java, C#, Visual Basic .NET, Ruby and Objective-C. Objects also form the basis for many web technologies such as JavaScript, Python, and PHP.

It is of vital importance to learn the fundamental concepts of object orientation before starting to use object-oriented development environments. OOP promotes good design practices, code portability, and reuse. But it requires a shift in thinking to be fully understood. Programmers new to OOP should resist the temptation to jump directly into a particular programming language (such as Objective-C, VB .NET, C++, C# .NET, or Java) or a modeling language (such as UML), and instead first take the time to learn what author Matt Weisfeld calls "the object-oriented thought process."

 

So hopefully my investment in this book will help me towards being a programmer who can learn scripts and not somone who is trying to learn scripts without a basic foundation.

If you are starting out there really isn't a need to learn OOP. A lot of languages, like PHP, can be procedural (step by step) which is a lot more logical and useful for scripting when starting out. Jumping straight into OOP will be overwhelming and its benefits won't be apparent until you start working on larger applications. Besides a lot of what you learn will be transferable to OOP later on.

 

In regards to learning PHP functions. You will remember most of what you need over time and Google the rest. There is nothing wrong with referring to the manual :)

  • 4 weeks later...

I remember thinking like you, and all that happened is that i felt overwhelmed, it wasnt a helpful feeling and it delayed the position i am now, which i like to think is a stage up from where you are.

 

As mentioned above by andy9l learning the programming syntax of each language and general programming fundamentals is the way to go.

Personally if your learning PHP, i would recommend you learn mysql at the same time(or just SQL), because php is pretty much a side server language.

 

If i was teaching someone

SQL

JAVASCRIPT

PHP

(AJAX which can combine all three above)

JAVA

PHP OOP

 

I think this might the easiest order to learn

 

anyways back on point once you know what your doing in terms of programming basics and the first of these three languages can work together to make something really nice,

I recommend a user supplied information, php calendar with java-script functionality

 

P.s once your working a one project or more http://www.w3schools.com/php/ and http://php.net are your best friends, to learn each function that you need as you go along and use or find better solutions to old problems reference back to them to get some insights..

 

P.ss If you can master that try AJAX

 

 

I think maybe a quick check of w3fools is in order here!

I think maybe a quick check of w3fools is in order here!

 

The problem you speak of seems somewhat of a non problem..

 

I appreciate that the w3 isn't the sole authority of the web and programming, but to discredit completely because they dont update frequently enough is exaggerated issue and a waste of time.

 

In 99.9% of cases using w3 will provide you with the ground work of what you need.

Edited by sergRamalli

  • 1 month later...

Problem is people will always confuse the two.

W3 is where standards for the web should be studied - http://www.w3.org/TR/

W3Schools has nothing whatsoever to do with the W3 and as people keep pointing out should be avoided.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.