powered by Jive Software

How to creates/deletes rosters by PHP?

I hava a php website,and I want to creates/deletes rosters at the same time on my website and openfire.

for example:

The user A add a friend (called B) to his friendlist on my website,then the user B accept,Then when the A login Spark,B will Appear in A’s friendlist;

I want to use PHP to update the Openfire database,How to do?