functions.php 558 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * 判断是否为不可操作id
  4. *
  5. * @param number $id 参数id
  6. * @param string $configName 配置名
  7. * @param bool $emptyRetValue
  8. * @param string $split 分隔符
  9. * @return bool
  10. */
  11. if (!function_exists('is_config_id')) {
  12. function is_config_id($id, $configName, $emptyRetValue = false, $split = ",")
  13. {
  14. if (empty($configName)) return $emptyRetValue;
  15. $str = trim(config($configName, ""));
  16. if (empty($str)) return $emptyRetValue;
  17. $ids = explode($split, $str);
  18. return in_array($id, $ids);
  19. }
  20. }