再帰関数
/**
* 絞り込み検索の削除フラグのフィルターを設定します
*
* @param array|string $val 検索で使用するテーブルの配列
* @return array $where_list 絞り込み検索の条件が入ります
*/
protected function _set_is_deleted ($val)
{
static $_where_list = [];
if (is_array($val))
{
foreach($val as $datum)
{
$this->_set_is_deleted($datum);
}
return $_where_list;
}
$_where_list[$val . '.is_deleted'] = My_Model::DB_OFF_FLG;
return $_where_list;
}
/**
* Returns HTML escaped variable.
*
* @param mixed $var The input string or array of strings to be escaped.
* @param bool $double_encode $double_encode set to FALSE prevents escaping twice.
* @return mixed The escaped string or array of strings as a result.
*/
function html_escape($var, $double_encode = TRUE)
{
if (empty($var))
{
return $var;
}
if (is_array($var))
{
foreach (array_keys($var) as $key)
{
$var[$key] = html_escape($var[$key], $double_encode);
}
return $var;
}
return htmlspecialchars($var, ENT_QUOTES, config_item('charset'), $double_encode);
}
Author And Source
この問題について(再帰関数), 我々は、より多くの情報をここで見つけました https://qiita.com/katayamahide/items/3e824e246b3e01cef0cf著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .