Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

ajax_build_message()

Description

Builds a message to be used in an AJAX response

Parameters

ColumnTypeDefaultDescription
$msg string An end-user message explaining what happened (as a generic message for fails or part of errors)

Return

array Returns a message

Location

include/ajax_functions.php lines 134 to 148

Definition

 
function ajax_build_message($msg)
    {
    if(!
is_string($msg))
        {
        
trigger_error("\$msg variable must be string type!");
        }

    
$msg trim($msg);
    if(
$msg == "")
        {
        
trigger_error("\$msg variable must not be empty.");
        }

    return array(
"message" => $msg);
    }

This article was last updated 10th July 2020 01:05 Europe/London time based on the source file dated 18th May 2020 11:26 Europe/London time.