Welcome to the PHP Basics thread. This is the, well, the basics - a place to look up the most common new programmer questions that get fielded in the forum. Questions and comments welcomed, but keep in mind that it is requested that the moderators keep this thread more well pruned than most.
[EDIT]Please note, this thread is intended to be a place for looking up the most common new programmer questions. If you can’t find any helpful information here, Please search using the vBulletin Advanced Search and SitePoint’s [URL=“http://search.sitepoint.com/”]Advanced Search. If you still can’t find anything, please start a new thread in the appropriate forum. Please do NOT ask questions in this thread.
- Mittineague[/EDIT]
First - most basic of all - The PHP manual homepage for all languages, and [URL=“http://www.php.net/manual/en/”]The English Manual in particular. This covers everything though - so it can get intimidating fast.
That said, in your first six months or so with the language the section of that manual that you’ll spend the most time with is the base language reference. It and it’s table of contents are here.
- Language Reference
[LIST] - Basic syntax
- Types
- Variables
- Constants
- Expressions
- Operators
- Control Structures
- Functions
- Classes and Objects
- Namespaces
- Exceptions
- References Explained
- Predefined Variables
- Predefined Exceptions
- Predefined Interfaces
- Context options and parameters
[/LIST]
Second most important thing to know is how to post your code examples. This is done using the highlight bb tags. The highlight tags can be told which language you are using.
Examples:
PHP
[noparse]
<?php
// A simple hello world echo.
echo 'Hello World';
?>
[/noparse]
creates…
<?php
// A simple hello world echo.
echo 'Hello World';
?>
Note that there are [noparse]
[/noparse] tags as well, but these have trouble with the \ character which will appear in examples involving namespaces, so the highlight tag is prefered.
Highlight can also do javascript, html, css and sql. If your example involves these consider posting in the forums set aside for them unless PHP is heavily involved with your question.
And now for the questions. If you have one that isn’t here then ask it.
Table of Contents:
[post=4753509]Coding Format Conventions[/post]
Moderators: If this thread catches on please stick - also please keep the Table of contents up to date.