$data, 'signature' => array( 'signature' => $signature, 'timestamp' => $timestamp, 'nonce' => $nonce ) ); return json_encode($signed_message); } function generate_random_string($length) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%&*()_-+='; $random_string = ''; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, strlen($characters) - 1); $random_string .= $characters[$index]; } return $random_string; } $data = array( "command" => "lastCall", "excluded_filename" => "lastCall.txt", "batch_filename" => "Communication_definition_SMS_1_wemedia_20230303185518.txt", "data_filename" => "Communication_targets_SMS_1_wemedia_20230303185518.txt" ); echo sign_message($data);