r/PHPhelp • u/CodeGolem • Aug 15 '20
Wondering how some of you started learning PHP
Hi, if anyone had any spare time, I would love to hear how some of you guys started learning PHP. I'm trying to learn PHP but I am having a hard time trying to get some deep understanding of the language. Im more of the "get the basics down" kind of guy then try doing a basic project so I was wondering if I could get a direction or some ideas.
I checked the PHP subreddit, but it seemed like this was the more appropriate area. If not, then I'd love to hear where I can ask around. Thank you!
3
u/criptkiller16 Aug 15 '20
Started learn PHP with a old software called Adobe Dreamweaver , I didn’t understand what code was produce when drag & drop some components. Then I started read code.
One day, my future wife, got money to buy me a jacket, because I was very poor guy, withou any money. We redirect that money to buy a book called PHP 5.3 which cost 50€ back in those days.
Now I earn more than avg guy in tech guy in Portugal. Happy coding to you! Cheers
2
u/CodeGolem Aug 15 '20
Aww that's so sweet. Hey cheers to you as well! Im in a long distance relationship and my girlfriend always picks up the slack because she has a great job. I want to be able to get jacket money for her and support and provide for her!
2
u/criptkiller16 Aug 15 '20
I hope that you can be very successfully on this area. Keep fighting eventually you will be a successful person and be supportive! Sorry any typo, I’m non native English person, do my best to express my self.
Without my girlfriend can’t imagine my life without it. Now I’m support my girlfriend on her university fee’s, my wage is more than enough to pay my rent house, food and for her.
Have nice day!
2
Aug 15 '20
I can't even remember.
But when I did modphp was part of every apache install so it was already there. All I had to do was drop a .php file in doc root and it worked.
3
u/CodeGolem Aug 15 '20
Hm, I think I understand. I'm using xampp as my local server and the first "ah ha" moment was that I can drag and drop PHP code into the root folder haha
2
Aug 15 '20
I got a job as a PHP dev, I didn't like vanilla PHP so I picked up the Symfony framework.
I never used PHP before, and a year in and I'm still learning. But I've built a web app for work from the ground up so I guess I'm getting there.
1
u/CodeGolem Aug 15 '20
That's amazing. Hey, I think you've already got there in my opinion! I'll have to make a note of Symfony and check that out later. I know laravel is a popular PHP framework but all's fair since I'm getting there! Haha
2
u/RedDragonWebDesign Aug 15 '20
If you're just starting PHP, don't learn a framework yet. They're complicated.
Later, when you're intermediate, Laravel is the most popular framework. Also, a framework will force you to use something called MVP, which is basically separating different types of code (HTML, PHP, SQL) into different files. Great way to organize.
But stay simple in the beginning. Don't worry about that stuff yet.
1
u/CodeGolem Aug 15 '20
Alright. Yeah, I'm not at that stage yet so a framework is definitely not any time soon haha
1
u/midniteslayr Aug 15 '20
I got started developing with PHP around 1997/1998 with a rather decent book on PHP. I started working on my own website, then moved to making web apps around 2000/2001. My first web app was a simple application to save bookmarks from your web browser, similar to deli.cio.us
From there, I ended up getting my first job, and it was all uphill from there.
If you're just getting started, my only suggestion is to not be afraid of failure. Don't worry if your first stuff isn't awesome, it will get better and better once you learn more and reframe your thinking to how the code will work. Hell, I've had a professional career with development for around 15 years, and I'm still changing my code and style as I evolve. I can't tell you how many times I have thrown something away to rebuild it slightly differently later, with more wisdom on how to approach the challenges that I faced in the past.
1
u/CodeGolem Aug 15 '20
Thanks! I have the basics for Vue down and I want to mix that with PHP to hopefully get towards the door of working with databases as well. I appreciate how much you typed and thanks again! 👍
1
u/sevidmusic Aug 15 '20
I got started because my band needed a website, one of the best things I did at the beginning and still do today is to read other peoples code, specifically from projects you admire.
Also, something I learned over time is that coding well is not language specific, a great way to get better at coding in php is to learn to code in other languages too, perhaps implement something simple in php and python so you begin to understand programming more deeply.
Listen to smart coders that came before you, Kevlin Henney, and Robert C. Martin are two of my favorites, they have really influenced my perspective on programming.
Despite what some may say, don't be afraid to reinvent, or rebuild the wheel, understanding what has already been done is a necessary part of creating something new.
2
u/CodeGolem Aug 15 '20
Okay, I will have to take a note of those names. I never thought about that before. I really appreciate that! I was interested in reading how others structured their react components so looks like I'll be spending more time on git haha
1
Aug 15 '20
i bought a book on called "jump/quick start php & mysql" and i took off
1
u/CodeGolem Aug 15 '20
Haha I've found books to be very motivating for me too. Did you have any prior knowledge of PHP or MYSQL? That is on also on my list but I didn't know if I should do PHP and learn that first or do both...
1
u/Glyphosate666 Aug 15 '20
My first project I had to do for school was a Pizza shop. Had to present the project with UML before. Then it had to be built following MVC. It needed a basket, a custom pizza system, promotion coupons, newsletter. Since this was about PHP, focus was not that much on the front-end and most of the point where given on how back end had been put together. We had 48h to finish the site. I found that one of the best learning exercices i ever went through.
1
u/CodeGolem Aug 15 '20
What kind of dynamic elements did you use for the website? That doesn't sound like a lot of time but I wish there was a class like that at my school! Thank you!
2
u/Glyphosate666 Aug 15 '20
Wasn't much time indeed. But part of the programming job is to be able to do it under pressure. Our teacher always made sure we got it in everything he asked us. He was also a no pitty guy when it came to evaluate, just as a client would be receiving his product. I hated him, but he was a good teacher for sure.
1
u/fhgwgadsbbq Aug 15 '20
I got a PHP4 book from the local library, then started doing open source fixer-oos for Moodle. That led to a job doing Moodle development!
1
u/CodeGolem Aug 15 '20
Oo did the PHP book give you all the knowledge you needed to start working on open source projects? Also, that's great to hear! I've never heard of Moodle before
1
u/fhgwgadsbbq Aug 16 '20
It gave me a good base of knowledge but most of what I learned was on the job as a junior developer. (this was 10+ years ago)
1
u/tousonuk Aug 15 '20 edited Aug 15 '20
I blagged a job as a PHP developer for a local design firm (having not done any PHP) and learnt on the job. It was a steep learning curve but was a great boot camp to springboard my knowledge (if you don't know how to do something, learn it pretty damn quickly).
Probably not the advice I would give to anyone starting out, but that was my experience.
1
u/CodeGolem Aug 15 '20
Haha no no I'll keep that in mind. How did you prepare for the interview in that case?
2
u/tousonuk Aug 15 '20
The handy thing was, I was the only programmer in the business as it was a design studio. They didn't know what I didn't know and didn't know what to ask to find out, so just sounding confident was enough to convince them I knew what I was talking about. ;o)
Google was my best friend for the first 6 months while I was learning.
I picked up a lot of bad practices and made a lot of mistakes doing it this way as I didn't start with a solid academic background in the subject. It's taken me years to fully understand the correct way of doing things, but it did get me earning straight away which was important to me at the time.
1
u/CodeGolem Aug 15 '20
Thats great to hear 😊 Im a senior at my University so I'm still trying to figure out where to start when I take my foot out the door. I don't think your academic background stunted your achievements. I will probably stumble my way too so I think you're good.
1
u/SwiftNinjaPro Aug 15 '20
Wordpress
1
u/CodeGolem Aug 15 '20
Yeah I remember WordPress uses PHP, but I've yet to try it out. I guess when I get okay with PHP I'll check out WordPress! Thanks!
1
u/drwho_who Aug 15 '20
ASP.NET made me do it, about 20 years ago. Glad I made the switch.
1
u/CodeGolem Aug 15 '20
What kind of work did you do when you switched? Did you have any prior experience before that helped with the switch??
1
u/P1nnz Aug 15 '20
It was forced upon me at my internship, I only had some experience with C++ and python at that point.
Now I've come to love it, even though I use it pretty much strictly for building cli tools. It just makes everything so easy and is so fast.
It always bugs me the hate it receives but I can also understand it if you're only exposure was to version 5 and down.
1
u/CodeGolem Aug 15 '20
Yeah I've heard so many comments about how PHP is dying but that doesn't feel true after seeing this sub and all the companies that use it. I was also wondering about python and Django but I was more interested in learning PHP 😊
1
u/P1nnz Aug 16 '20
It's certainly not dying, and honestly with PHP 7+ I'm personally hoping for a resurgence lol. If you're looking at Django but don't want to use Python then I've heard amazing things about Laravel or Symphony. I've worked with python a bunch of times and always feel like things are harder to implement and slower compared to modern PHP. (outside of certain libraries python has)
I also like how PHP's syntax is closer to most other languages :) moving from PHP to c/c++, java, c# etc. is IMO much easier than from python.
1
u/CodeGolem Aug 16 '20
Haha well amen to that! I heard that the improvements for PHP 7+ are amazing. After hearing about PHP for everyone else I think I'm set on PHP. Im moving from Java and Python to PHP so that's great to hear
1
1
u/RedDragonWebDesign Aug 15 '20 edited Aug 15 '20
I taught myself PHP back in high school. I wanted to set up a website for my gaming community, and I found a gaming community CMS written in PHP. I downloaded the code, analyzed it, and started using the patterns from that to write my own website.
That's probably not the easiest or best way to learn though. You might want to start with a YouTube tutorial series, then some small projects like simple games (chess or sudoku or something), and supplement that with googling and reference websites (php.net, w3schools, etc)
A big part of being a programmer is google-fu: googling well. We look things up all the time. Don't try to memorize everything, just memorize the fundamentals, and look everything else up as needed.
Also, if you've never programmed before, make sure to learn fundamental programming patterns. Things like if/elseif/else, loops, arrays, functions, variables. Those are the same in every language, and they are the building blocks of all programs.
2
u/CodeGolem Aug 15 '20
Yeah I've had experience with Java and Python so the basics weren't too bad to understand and I just got through the exercises for w3schools! Sudoku doesn't sound too bad. You sound really smart. Thanks for the advice 😊
3
1
u/raine1912 Oct 21 '20
I started with smf I think, simple machine forum thing. Created my own forum for sharing anime and stuffs. Then I wanted to add more functions, upgrade the site etc and bam, I was learning PHP And MySQL. At that time I also coded my first php app thingy for people to share megaupload, rapidshare links etc. They get points when people download their links, and use points to download other links. Those were fun days ha ha. Then someone decided to ddos me and I found myself learning about networking, ddos and such.
Then I opened my first ecom website, used zencart and started hacking around more with PHP, javascript, html, css...
Those were the days.
•
u/danabrey Aug 15 '20
This doesn't really fit on this sub, but there's some really good discussion here so making an exception and leaving it up.
0
Aug 15 '20
[deleted]
1
u/CodeGolem Aug 15 '20
Thanks! I saw the section on PHP form handling and thought I'd start with a simple PHP form!
6
u/[deleted] Aug 15 '20
Somebody in college I liked said, "Hey, you're pretty smart, can you make me a website for my club?" I agreed to do it. The website needed some dynamic elements, and I discovered PHP. Bit by bit, as I added more features to the website, I learned more and more about PHP and website development from websites like PHP.net and W3Schools.com. (Nowadays, I'd use Stack Overflow). Over the years, PHP matured and more and more frameworks and libraries were developed. This turned into a 15-year career (and marriage, for those who are curious).