本文整理汇总了PHP中SJB_HelperFunctions::unset_unnecessary方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_HelperFunctions::unset_unnecessary方法的具体用法?PHP SJB_HelperFunctions::unset_unnecessary怎么用?PHP SJB_HelperFunctions::unset_unnecessary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_HelperFunctions
的用法示例。
在下文中一共展示了SJB_HelperFunctions::unset_unnecessary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
/**
* generating hidden items of request form
*
* Function generates hidden items of request form
*
* @param array $newparam data for hidden items,
* where keys of array are names of variables
* and values of arry are values of variables
* @param bool $pass_all defines unsetting of value of request data named 'action'
*/
public static function form($newparam = array(), $pass_all = false)
{
if ($pass_all) {
$arr = $_REQUEST;
unset($arr['action']);
} else {
$arr = SJB_HelperFunctions::unset_unnecessary($_REQUEST);
}
foreach ($newparam as $name => $value) {
$arr[$name] = $value;
}
foreach ($arr as $k => $v) {
if (is_array($v)) {
continue;
}
$arr[$k] = htmlspecialchars($v);
}
return SJB_HelperFunctions::array_to_string($arr, '<input type="hidden" name="', '" value="', '" />' . "\n");
}