PHP code example of yuanfenxi / yuanfen-sdk

1. Go to this page and download the library: Download yuanfenxi/yuanfen-sdk 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/ */

    

yuanfenxi / yuanfen-sdk example snippets


$user = new User;
$user->phone = 13255801983;
$user->password = md5("HelloWorld");
if($user->save()){
	echo "OK";
}else{
	echo "failed";
}

		 $userBehavior = new UserBehavior($UserModel->uid,"register-succ");
		 $userBehavior->parseAndFillBrowserAndOs();
		 $behaviorClient = new BehaviorClient("{YFX_KEY}","{YFX_SECRET}","{YFX_SID}");
		 $behaviorClient->postEvent($userBehavior);