phpSPO - the PHP Library that allows to perform CRUD operations on SharePoint list data, using an REST/OData based API for SharePoint Online.
The current version supports SharePoint Online using claims based authentication.
Examples
How to perform authentication in SharePoint Online (SPO):
try {
$client = new SPOClient($url);
$client->signIn($username,$password);
echo 'You have authenticated successfully\n';
}
catch (Exception $e) {
echo 'Connection failed: ', $e->getMessage(), "\n";
}
How to create SharePoint list item (task):
require_once 'SPOClient.php';
$username = 'username@tenant.onmicrosoft.com';
$password = 'password';
$url = "https://tenant.sharepoint.com/";
createTask($url,$username,$password);
function createTask($url,$username,$password){
$client = new SPOClient($url);
$client->signIn($username,$password);
$listTitle = 'Tasks';
$list = $client->getList($listTitle);
$itemProperties = array('Title' => 'Order Approval', 'Body' => 'Order approval task');
$item = $list->addItem($itemProperties);
}
You could find more details by follow this post
Disclaimer: I'm the author of the library