Want to learn a programming language? Can’t decide which will be most beneficial to you?
Here’s are 5 reasons you should learn PHP, and 5 things to watch out for if you do.
5 reasons to learn PHP:
1) PHP (Hypertext Preprocessor) is open source, which means it’s free to use.
2) PHP has a huge community of users and support groups, so getting answers is never a problem.
A great resource is http://stackoverflow.com/
3) Tons of pre-written functions and snippets already exist. Whether you need a calendar, complete CRUD (create read update delete) function, etc., they are easy to find and implement.
Check out https://github.com/ and do a search for your next script/function.
4) WordPress is built on PHP and currently the largest PHP CMS (content management system) in use.
5) Many well known PHP frameworks can make developing and coding quick and easy. A framework provides a structured, well-documented and supported platform to build apps on. Frameworks make building apps quicker and easier since
they provide a base to start from. Here are just two.
5 Things to Watch Out For:
1) Turn on debugging in the php.ini and/or add this code to your php pages. Preferably in an include for all pages.
It will show you errors that are not syntax errors and a great way to help you start debugging.
2) It is to create sloppy, unstructured code. The code will work, but unstructured code can be a nightmare to debug and modify. To resolve this, use a PHP Framework like the ones listed above.
3) Backward compatibility with older versions of PHP sometimes require code modifications. There’s no easy fix for this other than to use the PHP community, which is always a huge help.
4) Operator “==” vs “===” can be frustrating until you fully understand how PHP handles it.
For example, $a == $b
For this to be TRUE, values $a and $b are equal regardless of their types (string, integer, boolean, etc.)
$a === $b
For this to be TRUE, values $a and $b are equal and so are their types (string, integer, boolean etc)
5) It is advisable to leave off the closing PHP tag ?> . This will prevent accidental whitespace and/or newlines from being added to the end of your php file.
While both of these lists could go on and on, PHP is by far the most widely known and easiest language to learn. Like learning anything, the more you do it, the better you will get!