<?php
// includes/helpers.php

// Set PHP timezone to India (Kolkata)
date_default_timezone_set('Asia/Kolkata');

function now() { return (new DateTime())->format('Y-m-d H:i:s'); }

function validate_phone($phone) {
  $p = preg_replace('/[^0-9]/','', (string)$phone);
  return (strlen($p) === 10) ? $p : false;
}

function json_response($arr){
  header('Content-Type: application/json; charset=utf-8');
  echo json_encode($arr);
  exit;
}
