本文整理汇总了PHP中Sanitize::number方法的典型用法代码示例。如果您正苦于以下问题:PHP Sanitize::number方法的具体用法?PHP Sanitize::number怎么用?PHP Sanitize::number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sanitize
的用法示例。
在下文中一共展示了Sanitize::number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
// If there are no defaults
if (!isset($_POST['run_cycle'])) {
$_POST['run_cycle'] = 3600;
}
if (!isset($_POST['date_start'])) {
$_POST['date_start'] = time();
}
if (!isset($_POST['date_end'])) {
$_POST['date_end'] = 10;
}
// Sanitize Values
$_POST['title'] = Sanitize::safeword($_POST['title']);
$_POST['method'] = Sanitize::variable($_POST['method']);
$_POST['run_cycle'] = Sanitize::number($_POST['run_cycle'], 0);
$_POST['date_start'] = Sanitize::number($_POST['date_start'], 0);
$_POST['date_end'] = Sanitize::number($_POST['date_end'], 0);
// Sanitize Parameters
for ($a = 0; $a <= 3; $a++) {
$_POST['args'][$a] = isset($_POST['args'][$a]) ? Sanitize::text($_POST['args'][$a]) : "";
}
}
// Run Header
require SYS_PATH . "/controller/includes/admin_header.php";
// Get Navigation Entry
echo '
<h2 style="margin-top:20px;">' . ($editID ? 'Edit' : 'Create New') . ' Cron Task</h2>
<form class="uniform" action="/admin/cron/custom-task" method="post">' . Form::prepare("cron-custom") . '
<p>Title: <input type="text" name="title" value="' . $_POST['title'] . '" maxlength="22" /> (only useful to humans)</p>
<p>Method: <input type="text" name="method" value="' . $_POST['method'] . '" maxlength="22" /> (the MyTasks:: or Task:: method to call)</p>
<p>Parameters: