'create', 'key' => $secret_key, 'first_name' => 'John', 'last_name' => 'Smith', 'email' => 'john.doe@example.com', 'user_name' => 'john.doe', 'password' => 'Test@1234', 'account_state' => 'active', 'membership_level' => '3', 'subscription_starts' => date( 'Y-m-d' ), ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $post_url ); curl_setopt( $ch, CURLOPT_POST, 1 ); curl_setopt( $ch, CURLOPT_USERAGENT, 'curl' ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_arr ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $response = curl_exec( $ch ); curl_close( $ch ); $res = json_decode( $response, true ); if ($res !== NULL) { echo "
API response dump below.
------------------------
"; var_dump( $res ); } else { //API returned unexpected result echo "
Error occurred! API returned unexpected result. Check if CURL PHP library is intalled correctly on this server.
"; }