<?php

function verifyAppRequest(){

    return true;
}

function sendSuccess($data = []){

    echo json_encode([

        "success" => true,

        "data" => $data
    ]);

    exit;
}

function sendError(

    $message = 'Error',

    $code = 400

){

    http_response_code($code);

    echo json_encode([

        "success" => false,

        "message" => $message
    ]);

    exit;
}

function sanitize($text){

    global $db;

    return trim(
        $db->real_escape_string($text)
    );
}