March 19th, 2017, 09:41 AM
Which Parts Of Php Not To Learn ?
After getting putoff from php.net to learn php 7 (because it is not beginner friendly) and raoming around youtube for 1.5mnth to learn php and failing to get proper tutorials there, I returned to php.net. Was reading the CONSTANT chapter and really got pissed-off.
Read this page and tell me if it is a beginner friendly tut or not:
<a href="http://php.net/manual/en/language.constants.php">PHP: Constants - Manual</a>[<a href="http://php.net/manual/en/language.constants.php" target="_blank" title="New Window">^</a>]
I find contributor's quarreling in the comments of what works and what not. Obviously, one of them is right and the other wrong. Now, question is, why did php.net put the arguments of the incorrect person in front of us getting us newbies to read quarrels of an incorrect programmer going back and forth with the correct programmer ? Result ? Newbies get confused and put-off from php. Php seems like a neverending mess!
Anyway, I have come to the conclusion not to get my tutorial from there. Can use php.net as a reference in the future once more experienced. And so, heading towards tutoprialspoint.com.
This however, just lists the newly added features on php 7 and so no good to me:
</a>[<a href="http://www.tutorialspoint.com/php7/" target="_blank" title="New Window">^</a>]
And so, I guess you guys would recommend:
</a>[<a href="http://www.tutorialspoint.com/php/" target="_blank" title="New Window">^</a>]
But, looking at the chapters in their list, which ones (functions, etc.) are deprecated in php 7 so I shouldn't bother with them ? Do you mind pointing-out the chapters and their links from their tutorial ? You can find their chapters on the leftside of their page:
<a href="http://www.tutorialspoint.com/php/">PHP Tutorial</a>[<a href="http://www.tutorialspoint.com/php/" target="_blank" title="New Window">^</a>]
And no, phptherightway.com is not for beginners as it assumes you kno php 5 etc. which I don't.
PS - Remember, other newbies would find your contributions here and hopefully give you good rating.
March 19th, 2017, 09:47 PM
You'll find that many things have people on several side arguing about what is correct or best. A lot of stuff related to programming doesn't fall neatly into 'This is right, this is wrong' categories. There are always elements of style, use case, requirements, etc that will have an effect on how things are done.
Originally Posted by UniqueIdeaMan
As such in the manual's user notes you may find conflicting opinions on what is proper or acceptable. The user notes on the site can be rated, take that into account when reading them. A note that's rated highly is probably worth paying attention to. The rest you'll have to judge for your self about their worthiness. Also take the time frame into account, notes that were posted 5+ years ago may not be that relevant anymore. PHP.net provides the user notes system as a way for people to try and help improve the manual but like any user contributed content you should not take them at their word as something official and accurate.
If there some specific thing that is said in the notes that confuses you, then ask about it here or elsewhere to get more opinions.
Also, as you kind of found out the manual is not really intended as a tutorial. It's a reference that explains how the language works and details the various functions and syntaxes. If you want something that will try and explain when and why to use a particular syntax/function/concept then you'll likely want to look elsewhere.
I don't really have any recommendations for where to look. When I learned PHP I did so primarily just by referencing the manual, reading other source code and applying some critical thinking skills. Occasionally I'd ask for help on forums like this when I got stuck. I also learned PHP back in the PHP3 days so any tutorials I may have used then would be severely outdated now and since I haven't needed any basic tutorials since then I've not kept up to date on what is available.
I would consider PHP The right way to be perfectly fine. They do have a basics section if that's what you need to get you started. They also talk about many of the current best practices which is a good thing to follow. If some part of their content doesn't apply to what you're currently trying to learn then skip it. Come back once you are doing work in that area.
Like a most stuff on the internet as time passes things get outdated. Rather than recommend some specific set of tutorials I'd just recommend doing like I did. Use the manual to get familiar with general syntax and features of PHP. You don't need to go through everything right away, focus on what will help you accomplish your immediate goals. Look at existing open-source projects to learn new concepts about how to design and structure an application and apply some critical thinking to determine how you can apply those concepts into your own projects. There's a lot of decent frameworks around these days you can use as guidance as well as a basis for new projects.
If you're going to look for tutorials, try and find something specific rather than general. For example rather than just searching for "PHP Mysql tutorial" try something like "How to query a Mysql database with PHP" to focus on how to pull data out of a database using select queries and processing the results.
To try and answer your title question, "Which parts of PHP not to learn", avoid anything that has been marked as deprecated in the manual. Those items are obsolete and generally slated for removal so there's no point in learning them. That can help you judge the worth of tutorials you find as well. For example if you come across a tutorial trying to show you how to use the mysql_* functions, drop it and go else where. Prefer something that is teaching you PDO. Anything using the ereg functions is similarly out of date, prefer things focused on preg.
Recycle your old CD's, don't just trash them
If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
March 20th, 2017, 09:21 AM
Originally Posted by kicken
Cheers for your input! It seems you were in the same boat as me! Not being able to find proper tut and stick to bits of tuts here and there. I learned for 1 month from tizag.org in 2015 but then read php 7 out and syntax different and so waited for proper php 7 tut to come-out and bugged popular sites to update their tuts. When they finally did, they only mentioned what is new in php 7 and did not teach from "Hello World!" and so kept on waiting till now. Now, after waiting for over a year now started bugging you guys here for recommendations. About 7wks ago, I came to the conclusion that I won't be able to learn php in 4-6wks as going through all those lengthy codes in php.net from contributors (commenters) are really complicated stuffs. Will take 6 months atleast to understand all their contributed codes and complete the tut over at php.net. Therefore, took a shortcut to youtube instead to find those aspects of the code that will be needed to build a Social Network like facebook, youtube etc. but some of them had bad coding practice and their codes showed error either due to their bad practices or due to me modifying the codes to suit my purpose. Therefore, started bugging the forums. programmers have pointed-out a few problems with my codes and I see the badness is due to not my own mistake but what I learnt at youtube. For example on some vids they use <center> which is outdated at html 5. On one vid, the html code of the form was on the top while the php processor code was at the bottom. And a lot of other security issues (which programmers in forums pointed-out). I have now come to the conclusion that relying totally on youtube tuts is dangerous. Therefore, on the prowl again for the perfect online tut, paperback book, ebook, video tut to learn php.
I said many times before to other programmers, I was having problem finding a proper php tutorial site that taught php 7 as most tut sites are unupdated and teaching php 3 or 5 and php.net was not suitable as it is a reference site for intermediate/adv people who already know php. When folks started suggesting I learn php 7 from tutorialspoint.com and phptherightway.com I pointed-out those sites assume I know previous versions of php and so not suitable for newbies, some either suggested I learn from php.net (thus I had to repeat my refusal) and some agreed not many sites they're aware teach php 7 (those that do only teach what is new in php 7 and do not teach the whole lang) and I should look into those sites teaching php 5. I then had to repeat my refusal to learn php 5 from php 5 tut sites because I do not want to learn deprecated stuffs dropped from php 7 and I do not want to learn php 5 syntax and then learn php 7 syntax and get confused. I assumed php 7 syntax was more refined and different than previous versions but most recently programmers assured me the syntax is still the same and I should start learning to walk from php 5 tut sites since they start from the beginning ("Hello World!") and I can then migrate to php 7 tut site and learn what is different (new features). After a lot of beating round the bush and starting to believe them that syntax on both versions are same (I saw most youtube tuts using procedural and a few using pdo and noticed the different way of coding (syntax) to accomplish the same thing and wrongfully assumed the pdo style was php 7 and the procedural style is php 5 syntax. Hence, all the fuss about versions' syntaxes are different and so do not want to learn from php 5 tuts). I headed to php.net lastnight and found it totally a put-off. I then took everyone's advice and headed towards tutorialspoint.com and ignored the php 7 what is new in php 7 tut and glanced over to the php 5 tut instead. But to my dismay found it has no chapter on Data Types the very fundamental chapter and so I felt down again and decided to try another site. But before I try another, I thought best I gather the list of deprecated features that didn't find their way onto php 7 as that way I won't waste time learning old deprecated stuffs. Now, even though php 7 tut sites (that only teach what is new in php 7 - sites like tutorialpoint.com's php 7 tut and phptherightway.com) list the modern new functions but do they list each and every deprecated stuffs ? I do not think so. And so I'd accidently start learning old stuffs. Need to avoid this. Hence, the reason for opening this thread. Smart thing to do, you would agree.
Btw, These programmers in the forums, they can't say why I don't just go and learn php rather than waste time talking about it. Even now, I have sat infront of my computer to learn as much as I can from tutorialspoint.com if I can't find any better. I just thought best check the forum for you guys' inputs before embarking on my learning venture. That way, I can have oldbie programmers advice roaming in my head while I search for the perfect or near perfect tut sites.
You are welcome to suggest a site. Remember, all tut sites, books, vids are not same in quality and some teach bad practice and so I must be very careful where I step.
I repeat: As for now, heading towards tutorialspoint.com unless you guys know of a better site than it and phptherightway.com.
When I asked what not to learn, I meant which functions and extensions not to learn due to them being ditched. Mysql I know I should not learn as it has been replaced with mysqli. Those are the things I mean when I say what I should not learn. You understood my question but not that programmer (who now lashed-out at me for asking). And therefore, you now have no choice but to agree that it was not an "idiotic" question (like that programmer claimed), after-all but a smart one. He said I should not learn using sql queries with variables and lashed out why I not fix them yet after they pointed this security issue out to me recently), I defended myself stating that, the only other way to avoid that is do PREPARED STATEMENT stuffs (if I understood correctly) but to do that I need to learn PDO from tut others suggested. I checked out the tut few nghts ago but the subject is not for beginners.
PHP: Prepared statements and stored procedures - Manual
Therefore, have not changed my code to replace using sql queries with variables as I do not know how to substitute it with PDO yet. (I defended myself saying all that no to save myself from that same programmer's attack right now). Hence, went back to learning the basics lastnight. Once that is out of the way, I can then look into PDO and PREPARED STATEMENTS. As for now, my codes in that subject would be untouched and so ignore that aspect of my code and look into other parts that relate to the subject of the thread opened.
PS - I'm not sure if I should start on this link to learn php as it starts from COMPARISON OPERATORS. Should it not start like this ...
* Data Types (Strings - "Hello World")
before coming to Operators ? See, what I mean, when I say it is hard to find a tut for a complete beginner ? Nevertheless, I have noted the link you suggested. Thank you for pointing out to avoid ereg tuts!
Last edited by UniqueIdeaMan; March 20th, 2017 at 10:08 AM.
March 20th, 2017, 03:55 PM
You can't just refuse to use the PHP.Net manual. That's your only official source for how PHP functions. Maybe you'll need to search for additional references if the manual is not clear enough for you but you must still be willing to use it.
There have been several times in my past where something in a manual didn't really make sense to me so I'd find some other source that explains it better. After getting the basics figured out else where though I'd revisit the manual and often figure out even more which my alternate source did not cover.
PHP has one of the best official manuals around, so if you are struggling with understanding it then you'll really be suffering trying to learn other languages or systems.
PHP 7 introduces new features that help improve code quality which does add a few new syntaxes, but all the original PHP 5 syntax is still valid. If you want to learn PHP 5 first and ignore the PHP 7 features for now then you can. You could also just look at some of those pages that talk about the newer PHP 7 features and try to apply them to whatever PHP 5 level tutorials you find.
PDO uses what's known as Object-oriented programming which is a particular style of application design and development. Mysqli can be used in either an object-oriented style or a procedural style. PDO is currently the preferred way to be interacting with a database using PHP so you should focus on that. Mysqli will work but it uses a complicated api for parameter binding and is vendor specific.
The basics page I linked is more about common misconceptions/mistakes than a step-by-step tutorial. I didn't really look over it completely at first. It's still something you should keep in mind and use what it says to supplement anything else you might find.
There's not that much you need to know about data types, variables and constants that would require tutorials for each one. For the basics all you need to know is what they are and how the proper syntax for them which is something the manual covers pretty well.
As I mentioned in my first post I can't really recommend anything specific for a tutorial, I've not keep up on what's available since I don't need them at this point. I still think the best way to learn is by exposure and when needed asking specific questions on resources like forums, stack overflow, etc.
Think about something you might like to create and then search for existing open-source software that accomplishes that goal or a similar goal. Spend some type looking at and modifying their code and if you find something you don't understand search for an explanation/tutorial. Many times this just means going to the manual and looking up a particular function or operator.
If you can find anything that explains it well enough then ask about it somewhere. Asking about actual code and it's purpose is likely to get a better response than asking about a generic concept or asking someone for a tutorial.
Try and start simple when browsing existing code. Starting out with something large like wordpress, drupal, symfony, etc probably will just be overwhelming. Sometimes finding a simple application can be tough, but using a narrow focus and searching github is a good way to start. Looking at individual libraries rather than full applications can be helpful too just to see how things are done.
Basically, don't worry so much about trying to learn everything and don't focus solely on learning from tutorials. Learn as you do, and use as many resources as you can to provide inspiration and examples.
Pick a project to work on and learn what you need to accomplish a task. Use similar applications and current best-pratice information as a guide.
Recycle your old CD's, don't just trash them
If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
March 21st, 2017, 08:54 AM
Originally Posted by kicken
Thank you again for your input. I'm heading toward tutorialspoint.com now.
What I meant was, I made php.net my first point of tutorial and got confused at the ARRAY chapter. I don't want to use php.net as a primary source for my learning. I need a site like tutorialspoint.com which are geared towards beginners like me. I will refer now and then to the php.net manual but not use them as my primary source for learning the php language since php.net are more of a reference manual than a tutorial for beginners.
I have donloaded about 100 vids from youtube. Most of them concentrate on how to build your own member-login site. Some of the vids I dowloaded cover the following:
* ho to build your own search feature (mysql)
* how to build your own searchengine
* how to build your own web crawler
* how to build a shout box
* how to build a chat like facebook chat
* how to build a LIKE button like facebook (was just going through the vid. It taught how to code so LIKEs get counted and shown what wa liked (article, etc.) and who liked them) but the tut on pdo for intermediate guys.
* how to INSERT into mysql
* how to DELETE from mysql
* how to UPDATE from mysql
* how to multi delete entries from mysql
* and so on.
Grabbing all the basic codes that deal with mysql commands. AFterall, I need to learn the php codes that interact with mysql. Once I get the inputting & outputting parts out of the way then I should be able to build my own membership site, SN (social network), forum.
Whatever platform I go to, I alway find improvements. Can always think of good features, which if they existed would make members' lives easier, make them stick to the platform, earn money for the members.
Learning php so I can give life to my ideas.
Right now, I am trying to build a web version of the Fan Browser (.exe). Hence, all the fuss to learn php. Lateron, will move-on to Python and learn Django.
Do checkout the Fan Browser. Because, if you do, you yourself would start getting ideas on what php scripts to build: