PHP has been at the helm of the online for several years. It’s a particularly popular, interpreted scripting language that's ideally fitted to web development partially because it's an approachable syntax and supports different operating systems. PHP codes are often executed with a command-line interface (CLI) and to implement standalone graphical applications. The language offers a really complete set of object-oriented programming features also as support for functional php programming. The newest TIOBE Index ranks PHP in 7th place, behind Java, C, and C++, C #, Python and Visual Basic.
Use PHP Core Functions and Classes
If you’re trying to try to something that seems fairly common, likelihood is that, there’s already a PHP function or class that you simply can cash in on. Always inspect the PHP manual before creating your own functions. There’s no got to create a function to get rid of the white space at the start and at the top of a string once you can just use the trim() function. Why build an XML parser for RSS feeds once you can cash in of PHP’s XML Parser functions (such as xml_parse_into_struct)?
Create a Configuration File
Instead of having your database connection settings scattered everywhere, why not just create one main file that contains its settings, and then include it in your PHP scripts? If you would like to vary details afterward, you'll roll in the hay in one file rather than several files. This is often also very useful once you got to use other constants and functions throughout multiple scripts.
Don’t Over-Comment Your Code
Proper documentation of your code through comments in your scripts is certainly an honest practice, but is it really necessary to comment every single line? Comment the complicated parts of your ASCII text file in order that once you revisit it later you’ll quickly remember what’s going, but don’t comment simple things like your MySQL connection code. Good code is self-explanatory most of the time