bin2hex($ciphertext_crypto_box), 'ciphertext_crypto_secretbox' => bin2hex($ciphertext_crypto_secretbox), 'debug' => '...', ]; $text_debug .= "\n".'RETURN TO AJAX: '. json_encode($return_arrayExample)."\n\n"; $return_array = [ 'ciphertext_crypto_box' => bin2hex($ciphertext_crypto_box), 'ciphertext_crypto_secretbox' => bin2hex($ciphertext_crypto_secretbox), 'debug' => $text_debug, ]; echo json_encode($return_array); exit(); }