25 Resources to Get You Started with PHP from Scratch
Dec 23rd in Web Roundups by Drew Douglass
Not too long ago, Jeffrey wrote an excellent article on resources to get you started with jQuery. Now its time to give some love back to the server side, and become more familiar with PHP.
PHP is a scripting language that is perfect for developing dynamic web pages and applications. You may be a PHP ninja, or perhaps you don't even know what PHP stands for. However, if you plan on or are involved in any kind of web development, you are bound to run into this fantastic and easy to learn web language. Today we will review 25 resources to get you started with PHP.
Hi, I'm Drew and I am a freelance developer and designer. I love all things having to do with PHP, MySQL, CSS, or jQuery. You can find my weekly articles on the ThemeForest blog and at Dev-Tips.com. Feel free to follow me if you're a fellow twitter addict.
So what the heck is PHP?
Straight from the manual, PHP is "a general-purpose scripting language that is especially suited for web development and can be embedded into HTML." PHP is a server side scripting language, meaning all data is interpreted and sent to the browser before the web page is loaded. This is the exact opposite of Javascript, which we call a client side language. All you need to keep in mind is that PHP is a web language that operates and runs on the server side. Next we will study the advantages of PHP and basic syntax before diving into to various resources.
What are some advantages of using PHP?
Every web language comes with its advantages and disadvantages, and you will find PHP is no different. However, PHP is a popular web language for many reasons.
Easy learning curve. The less time you have to spend searching the manual and studying a web language, the more time you will have to actually create and optimize your application. One of PHP's best features is that it is extremely easy to learn compared to other web languages. The syntax is arguably logical and many of the common functions describe exactly what they do.
Familiar syntax. PHP is a great language for developers with programming experience, especially programming in C and Perl, which is what PHP's syntax is mostly based on. If you know how to program in C and/or Perl, you wont have any issues writing applications in PHP.
Cost. It's free and open source. Can't beat that.
Performance.PHP is a relatively efficient web language. Scalability in your code and applications is very important and you can rely on PHP to serve as many web pages as you need efficiently (of course, it can't help if your coding inefficiently).
Community. The PHP community absolutely rocks. You'll find some of the most in-depth and comprehensive documentation of the entire language at php.net. In addition, there are thousands of PHP help forums and websites to help you when you get stuck. Furthermore, since PHP is open source, it is constantly being improved. PHP 5 recently implemented very strong support for object oriented programming and the language continues to become more powerful.
Overview of the syntax
In case you have been living under a rock and have never seen a PHP script, here is a very basic example of how PHP is written.
<?php echo "Your first php script!"; ?>
A few things to note. Notice the opening tags start with <?php and end with ?>. You may see some developers leave off the 'php' after the question mark. This is called using PHP short tags and is considered bad practice, always use full php tags. You will also notice that the line ends with a semi colon, if it does not PHP will throw an error. Now lets move on to some resources to get you started.
Step 1. Download PHP and learn the fundamentals.
First things first, we need to download the latest version of PHP and install it so we can work with it locally.
Visit PHP.net to get the latest version and any libraries you wish.
Recommended Reading
-
Installing PHP on any OS.
Straight from the manual, follow the link below to get started installing PHP on any operating system you happen to be running on.
Visit Article
-
PHP 101-For the absolute beginner.
I still find myself coming back to this article on the zend dev zone. If your new to PHP, this is a must read tutorial/guide.
Visit Article
-
PHP.net-your first script.
Time to get down and dirty with your first php script from the PHP.net manual.
Visit Article
-
Tizag-a complete walkthrough.
Odds are you have visited Tizag.com sometime in your web development career, and you can find a giant section of php tutorials at the link below.
Visit Article
-
Webmonkey-PHP tutorial for beginners.
Webmonkey has an extremely in depth article for those new to PHP, covering everything from variables to functions to loops and operators.
Visit Article
Step 2. Intermediate techniques and MySQL databases.
Now that you have learned the basics and fundamentals of PHP, lets move onto some intermediate techniques and using PHP with MySQL to create dynamic websites. PHP works extremely well with MySQL, which is a database language. Using the two together, we can create nearly any kind of website we wish.
Recommended Reading
-
Installing MySQL and getting started.
This article from the php manual will get you started and show you how to install MySQL and use PHP to interact with the database.
Visit Article
-
PHP-MySQL tutorial.
Everything you need to know about using PHP to interact with your newly setup MySQL database. How appropriate that the site is named "php-mysql-tutorial.com".
Visit Article
-
Tizag-MySQL introduction with PHP.
Tizag takes you through each common MySQL and PHP command needed to get started building database driven websites.
Visit Article
-
User Membership with PHP.
Now that we know how to use PHP and MySQL together, we can create a basic user login script.
Visit Article
-
Secure file upload with PHP.
Uploading files is certainly a great way to add interactivity to your site, but this must be done with caution. Below is a great article on uploading files securely with PHP.
Visit Article
-
Regular expressions introduction.
Using regular expressions is a great way to validate and verify user input to meet your exact needs. Learning the syntax can be a little tricky, so we'll cover a few regular expressions tutorials.
Visit Article
-
A crash course in regular expressions.
Jeffrey delivers with another awesome screencast on using regular expressions.
Visit Article
-
Regular expressions cheat sheet.
Cheat sheets are incredibly useful to any programmer or developer and below you will find an excellent regex cheat sheet that you may download for free.
Visit Article
-
Dev zone security tips.
Security is an important part of your application design so be sure to visit Dev zones' section on security tips.
Visit Article
-
10 PHP security checks.
From O'Reillys dev center comes a list of 10 PHP security checks to make sure you are taking.
Visit Article
Step 3. Advanced and OOP techniques.
Moving right along to what I would consider more advanced PHP techniques, including object oriented programming. OOP has drastically improved since the release of PHP 5.
-
Using the GD library.
The PHP GD library is an image processing library you can install with PHP. The GD library allows you to manipulate images in thousands of different ways.
Visit Article
-
Writing secure php files.
A more advanced and in depth look at creating secure php applications.
Visit Article
-
Introduction to object oriented programming with PHP.
Object oriented programming is a confusing concept to many new programmers, the below tutorial will take you step by step through the basics of OOP.
Visit Article
-
A crash course into object oriented programming.
A slightly more in depth look and study of OOP with PHP.
Visit Article
-
Real world OOP with PHP and MySQL.
Nettuts brings us an excellent real world example of OOP being used to connect and manipulate a MySQL database.
Visit Article
Step 4. Using PHP frameworks.
There are hundreds of PHP frameworks in existence now days, most are based on the MVC approach. Below we have listed some of the better PHP frameworks.
-
CodeIgniter.
One of the most highly praised PHP frameworks, Code Igniter claims a small and powerful footprint to help you quickly develop applications.
Visit Article
-
Symfony Project.
The Symfony Project is a full stack PHP framework built with PHP 5 library classes.
Visit Article
-
Akelos.
Another framework based on MVC, Akelos claims to be a simple ans easy to us PHP framework.
Visit Article
-
Zend framework.
The ever popular Zend framework is an extremely powerful framework with a slightly higher learning curve.
Visit Article
-
CakePHP.
CakePHP might just be the most popular PHP framework around right now. One of the highlights of CakePHP is the fun and easy to understand documentation, which teach you how to "bake your cake".
Visit Article
That'll do it for today's round up. Please let us know if you have any resources or articles we missed in the comments section!
User Comments
( ADD YOURS )Brenley Dueck December 23rd
Excellent Article!
Takes you from the beginner stages, right to the advanced PHP frameworks.
Have a great christmas all!
( )rp December 23rd
symfony is seriously the best framework by far! its slightly bloating but then its the balance you need, worth exploring once you have the basics of php
( )guile December 23rd
great article, as always!
( )Lamin December 23rd
Great list..thnx for the post.
( )Mathew December 23rd
You made a typo.
>> Another framework based on MVC, Akelos claims to be a simple ans easy to us PHP framework.
“ans”.
( )xQlusive December 23rd
This is an good article for the first steps into PHP development.
( )Chad Warren December 23rd
Awesome collection of VERY useful information.
( )Bogdan Popa December 23rd
Not to be mean but, GD isn’t an “advanced oop technique”, it isn’t even oop and the oop presented in the other tutorials is outdated, you should point people to the (relatively) new (better) way of doing oop (php5’s been around for a while now, you know).
( )Bogdan Popa December 23rd
Oh, sorry. I read the header wrong. Please ignore my comment on gd (the oop ones still stand ‘tho).
( )Drew December 23rd
@Bogdan- I didnt say it was an OOP technique, if you read the header for step 3, it is supposed to read “Advanced and OOP techniques” emphasis on the “and”. Maybe I should have written “Advanced techniques and OOP techniques”?
As for the tutorials, I liked them and have used them before while learning. By all means if you have some to share with us please dont leave us hanging
Drew
( )Drew Douglass December 23rd
@Bogdan-
No worries, I probably should have worded that differently. Its meant to read as “Advanced techniques and OOP techniques”.
Regarding the tuts, sorry you didn’t find them useful, but I actually used these when first starting out which is why I went back to them. I would love to see the ones you enjoy though, please do share them
-Drew
( )Mike December 23rd
So is this starting the Learn PHP From Scratch series over again or is this just a refesher? I have been hoping the series would pick up again….
( )DKumar M. December 23rd
Nice list Douglass, Useful for every PHP developer in general.
Thanks for sharing.
( )Drew Douglass December 23rd
@Mike-I’m not sure, I’ll have to see what the boss man says.
@DKumar-Thanks very much, I appreciate it. Also, Douglass sounds totally cool when you say it like that
Also forgot to say Happy Holidays to all! Hope its a good one
( )andylay December 23rd
Excellent article, great for anyone new or who needs a quick refresher (like me) before starting a new project.
( )devlim.com December 23rd
Great resources, but still need time to master PHP language.
( )Jeffrey Way December 23rd
@Mike – No not exactly. That will resume in January on the ThemeForest blog. “PHP for Absolute Beginners: Video Series”.
I’d let Drew write them…but I want it for myself!
( )Kenny December 23rd
Great tutorial! But I have a question:
I’m a big ASP.net/c# developer. What would be the reason to choose PHP over that technology?
I know VERY little about PHP, I guess thats why I’m asking.
( )Joey December 23rd
Great resources for learning PHP.
I noticed the link for “Regular expressions introduction” points to the same link as the secure file upload link.
( )Jeffrey Way December 23rd
@Kenny – I’m into ASP.NET as well. For business applications, I still think that ASP is the way to go.
On the other hand, PHP is much, much easier to learn. You’ll learn it in a fifth the amount of time it takes to learn ASP.NET.
But I still love both!
( )mike December 23rd
Jeffrey, I am looking forward to it, I found the original series very helpful.
( )Kenny December 23rd
@Jeffrey Way – I mostly write business applications with database backends. What application examples can you give that would be written efficiently in PHP?
Thanks!! I’m still bookmarking this post
( )Simon December 23rd
TYhanks very much, very informative!
I am following the newbie tutorials and it is really great!
( )Sumesh December 23rd
Useful. I’ve been going over your “PHP for beginners: a training regimen” post, and wished for more. I guess you’d really get what you wish for on Christmas eve
( )Sam December 23rd
In terms of frameworks, you should really mention Kohana. It was originally based on CodeIgniter before getting a complete re-write, to the extent where it is now enhanced to work purely around PHP5 (no PHP4).
It is incredible compared to both CI and Cake.
( )Rob December 23rd
Yet another great post. Thanks for the resources
( )kiran December 23rd
This is great resource for starters in PHP.Thanks…
( )Pieter Vriesacker December 24th
stop writing “your” when it needs to be “you’re”, get your language right man.
( )Mohsen December 24th
Great resources for beginners. I’ve written a similar post called:
( )PHP Tutorials Utopia: 13 Vital PHP skills for every novice PHP developer and solutions
you can check it here
http://acomment.net/php-tutorials-utopia-13-vital-php-skills-for-every-novice-php-developer-and-solutions/378
fatih December 24th
thanks man php is the best!
( )Ralex December 24th
I need this, so thanks!
( )Krishna December 24th
Wow !! this is a cool compilation of PHP resources all @ one place
( )Plaz December 24th
Oh! Great for us beginners! I always wanted to learn this. Thanks!
( )aljuk December 24th
Great post and threads, just what I’ve been looking for. Thanks.
( )I found it via popurls.com btw
José Mota December 24th
This is absolutely brilliant!
I really thought I didn’t know that much of PHP, like secure pages, GD and security.
There’s one thing you could mention though: WEB SERVICES. That would really kick it to the top. If you have something about it, let me know! Thanks and grats!
( )Ahad December 24th
Certainly an informative article. For those out there interested in Code Igniter -> yup it is an easy way to get started with php. There are many helper classes and libraries that you can drop in with one line of code. + great documentation and a great community.
Symfony and Cake are awesome but require you to use command-line syntax, which can be daunting (however i love the command line).
My advice would be to use a framework and don’t go the flat file way,as many intelligent developers have given you the helper files and classes to aid you with common tasks (forms, jscript, email attachments, pdf generators, etc etc.)
For you all out there thinking about Framework development consider Ruby on Rails as well. Rails is feature rich, and you can build apps quite quickly with the framework -> its just a matter of getting used to the syntax. It took me 30 minutes to develop a wiki with Rails including CMS, login and role management.
If you ask me Ruby’s syntax is much easier to read and if you are going to learn a new language then it could be Ruby. WOOT WOOT!!!
Here are some articles of interest:
( )http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html
http://andyjeffries.co.uk/articles/why-i-think-ruby-on-rails-is-an-ideal-web-development-environment
Robert D'Arcy December 24th
Performance.PHP is a relatively efficient web language. Scalability in your code and applications is very important and you can rely on PHP to serve as many web pages as you need efficiently (of course, it can’t help if your coding inefficiently).
you’re *not* your
( )cutt December 24th
great
( )Thanks for share this list !
Rob December 24th
re: Secure file upload with PHP.
That is anything but secure!
( )For starters anything uploaded should be saved outside the web root.
Thinking you’re safe by only accepting an image file is not a safety measure. Most image formats allow text comments where php code can be inserted.
I just worked through the security issues regarding file uploads and it takes some work to make it truly safe.
Patrick Allmond December 24th
If you are serious about getting started and getting good at PHP do not go to all of these product websites and try to download and configure everything. You will get frustrated and lose learning time. Go get Xampp. It installs Apache, PHP, Mysql, Perl, and FTP server and configures it all to work together out of the box.
( )Ryan December 24th
What is the best free php editor??
( )Matt Radel December 24th
Awesome! Please keep ‘em comin’…I’d love to see one on writing a dynamic navigation (with and without a db).
You guys rock – I look forward to catching some screencasts!
( )Demian December 24th
Thanks! i really need something like this for my auto learning in the php world.
( )Guys, you rocks!
BoltClock December 24th
CodeIgniter ftw!
Thanks for posting this resource, I’ll definitely share it with my friends who want to get started
( )Bogdan Popa December 24th
@Drew – The two best I’ve seen are probably http://www.hudzilla.org/phpwiki/index.php?title=Object-oriented_programming and php.net’s oop part of the manual (http://us.php.net/oop).
( )SuperMario290 December 24th
Amazing article, thanks tons for all of the links and resources!
( )Triple-H December 24th
MANY THANKS!!
I am new to PHP and I’ve been waiting for such tutorial.
THANKS again
( )Jack December 24th
Another solid framework is Kohana, which branched from CodeIgniter. It’s not the best documented, but it’s lightweight and comes with some interesting optional bundles (Google Maps library, etc.)
( )Page Gardens December 24th
Fantastically useful article! Been looking to get started with PHP
( )oztecnic December 24th
Good collection thanx
( )Harry M December 24th
This is great, wonders why CI is the first on the PHP framework list…:D
( )slack5 December 24th
Great list!
( )I’ve worked with most of the frameworks mentioned. CI is great for small, simple and lightweight projects. Symfony i would only use with a massive server setup. Everything else gets Zend
jason kempshall December 25th
Awesome article, just the thing i’ve been looking for! thats my Xmas day sorted then!
( )zoel December 25th
Greats!, but smarty template is easy too for newbe, aren’t u?
( )Eduardo December 26th
is it worth to learn Apache to improve PHP security? what do you think?
( )Wilco Dohmen December 26th
Nice write up, I would suggest http://www.phpvideotutorials.com to as a resource if you like to learn it with videos. From the basic free lessons to the paid how to create a small web app courses.
( )venkat December 27th
Awesome list. Also you should add phpunit framework in Step 4. When your application becomes complex phpunit will be your guard.
( )P-nut December 28th
Nice article, perfect as refresher or newbie.
@Pieter Vriesacker Drew made 1 spelling error using *your instead or you’re, all other uses of your were correct. Don’t coding geeks such as yourself have anything better to do than proofread for typo’s?
( )mrn December 28th
Verry useful, I was looking for somting like this, thanx
( )yamaniac December 29th
yaawnnn!!! PHP!
( )Jefferson Kirkland December 29th
Thanks a bunch for the links Douglas! For someone who is adding PHP to his arsenal, the links were a real help.
Happy Holidays!
( )Karol Adamczyk January 1st
This is great. Timing is perfect as I’m I’ve been planning to getting more into PHP.
( )Shannon January 5th
Excellent list. php is certainly all over the web but I think it’s difficult to find good tutorials and resources when you’re starting to learn the language. Thanks!
( )Kevin January 5th
Hi can someone please answer me. what should you learn first PHP or Ruby on Rails?
( )thank you.
Brian January 5th
Great article, I love the beginner tutorials
( )aljuk January 10th
@Ryan – I’d recommend having a look at NetBeans – I’ve been using it for a while and am very happy with it. It’s free, and cross-platform.
( )Ludger January 13th
good Stuff
( )husoinhurrvf January 23rd
thery nice
( )kookimebux February 1st
Hello. And Bye.
( )Christopher May 14th
What an amazing article, without treating us PHP newbies like total dimwits. I will be using the stated articles to improve my grasp of PHP. Thanks and I’ve placed your first “DIGG” too as requested.
( )Cheers. Chris.
Dennis June 19th
Nice article. I just don’t understand how PHP being “free” as an advantage. There is no programming language out there that will cost you anything. Performance wise, that’s arguable (compiled vs. interpreted)– it comes down to the code itself.
If you ask me, the major advantage of PHP is it being open-source and having the largest community (which means more resources available). Everything else isn’t.
( )Jaspal Singh August 17th
Awesome article.
( )Beginners must read this article.
Thanks for sharing.