ajax_send_response()

Description

Send AJAX response back to the client together with the appropriate HTTP status code

Parameters

ColumnTypeDefaultDescription
$code integer HTTP status code for this response
$response array Response data (@see other ajax_response_* functions for expected structure)

Return

void

Location

include/ajax_functions.php lines 42 to 47

Definition

 
function ajax_send_response($code, array $response)
{
    
http_response_code($code);
    echo 
json_encode($response);
    exit();
}

This article was last updated 11th June 2025 21:35 Europe/London time based on the source file dated 21st January 2025 15:20 Europe/London time.