Function __global->post_param_date_components

Definitions

sources/temporal2.php

  • Sanitise a POST inputted date, and get the date/time components.This does not support time zones. Use post_param_date_components_tz instead.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$stub ID_TEXT No No required parameter N/A N/A The stub of the parameter name (stub_year, stub_month, stub_day, stub_hour, stub_minute)
$year ?integer No No Null N/A N/A Default year (null: none)
$month ?integer No No Null N/A N/A Default month (null: none)
$day ?integer No No Null N/A N/A Default day (null: none)
$get_also boolean No No False N/A N/A Whether to allow over get parameters also

Returns

  • The date/time components
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Sanitise a POST inputted date, and get the date/time components.This does not support time zones. Use post_param_date_components_tz instead.
 *
 * @param  ID_TEXT $stub The stub of the parameter name (stub_year, stub_month, stub_day, stub_hour, stub_minute)
 * @param  ?integer $year Default year (null: none)
 * @param  ?integer $month Default month (null: none)
 * @param  ?integer $day Default day (null: none)
 * @param  boolean $get_also Whether to allow over get parameters also
 * @return array The date/time components
 */

function post_param_date_components(string $stub, ?int $year = null, ?int $month = null, ?int $day = null, bool $get_also = false) : array