If you have been following our online tutorials on Facebook application development since we launched them, then you are lucky.

If you are one of the late comers, you will find that our tutorials on FBML and the old PHP client library are a little bit outdated. If you follow "Our First Facebook Application " tutorial and try to copy the sample code from Facebook's official page, you will find that they are different from source codes listed in my tutorial. Fortunately, this should not be a big problem as the sample code is really simple and you can simply type it by yourself. It still works!

The reason why the codes are different is that Facebook is not using the old PHP client library anymore in their sample code. They are now demonstrating the use of the Facebook PHP SDK in their "get started quickly" sample code. (Frankly speaking, the revised sample code does nothing other than creating the "facebook" php object via the PHP SDK!)


Download the PHP SDK

The PHP SDK can be downloaded from github.com. At the time of writing this, the PHP SDK is at the version of 2.0.4.

The official Facebook PHP SDK contains three directories and a README file.


In the coming days, tutorials on using this PHP SDK will be posted.

Note: PHP SDK v3.0.0 was released on 21 May 2010. The code in this tutorial may not work in 3.0.0 (especailly on the authentication relatedcode), so kindly download the PHP SDK v2.1.2 if you are following this set of tutorial.