Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
25 righe
924 B
25 righe
924 B
<?php |
|
session_start(); |
|
date_default_timezone_set('Europe/Rome'); |
|
if(! empty($_GET["format"]) && $_GET["format"] == 'json') { |
|
$response = array( |
|
'year' => date('Y'), |
|
'month' => date('m'), |
|
'day' => date('d'), |
|
'hour' => date('H'), |
|
'minute' => date('i'), |
|
'second' => date('s'), |
|
'datestring' => mb_convert_encoding(strftime("%d/%m/%Y"), 'UTF-8'), |
|
); |
|
// $response['datestring'] = explode(" ",$response['datestring']); |
|
// $response['datestring'][0] = $response['datestring'][0]."<br>"; |
|
// $response['datestring'][2] = $response['datestring'][2]; |
|
// $response['datestring'] = ucwords(implode(" ",$response['datestring'])); |
|
echo json_encode($response, JSON_FORCE_OBJECT); |
|
die(); |
|
} |
|
$response = array('date' => ucwords(mb_convert_encoding(strftime("%d/%m/%Y"), 'UTF-8')), 'time' => array('h' => date('H'), 'm' => date('i'))); |
|
echo json_encode($response); |
|
session_write_close(); |
|
die(); |
|
?>
|
|
|