PHP code example of atiksoftware / php-class-facebook

1. Go to this page and download the library: Download atiksoftware/php-class-facebook library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

atiksoftware / php-class-facebook example snippets




use \Atiksoftware\Facebook\Facebook;
$fb = new Facebook();

try { 
    $fb->login("username","password");
} catch (Exception $e) {
    echo $e->getMessage(); 
}

try { 
    $fb->post("pageid","message_text","image_file_path");
} catch (Exception $e) {
    echo $e->getMessage(); 
}