国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
1.8KB

  1. <?php if (!defined('DEDEINC')) exit('dedebiz');
  2. /**
  3. * 扩展小助手
  4. *
  5. * @version $Id: extend.helper.php 1 13:58 2010年7月5日Z tianya $
  6. * @package DedeBIZ.Helpers
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. /**
  12. * 返回指定的字符
  13. *
  14. * @param string $n 字符ID
  15. * @return string
  16. */
  17. if (!function_exists('ParCv')) {
  18. function ParCv($n)
  19. {
  20. return chr($n);
  21. }
  22. }
  23. /**
  24. * 显示一个错误
  25. *
  26. * @return void
  27. */
  28. if (!function_exists('ParamError')) {
  29. function ParamError()
  30. {
  31. ShowMsg('对不起,你输入的参数有误!', 'javascript:;');
  32. exit();
  33. }
  34. }
  35. /**
  36. * 默认属性
  37. *
  38. * @param string $oldvar 旧的值
  39. * @param string $nv 新值
  40. * @return string
  41. */
  42. if (!function_exists('AttDef')) {
  43. function AttDef($oldvar, $nv)
  44. {
  45. return empty($oldvar) ? $nv : $oldvar;
  46. }
  47. }
  48. /**
  49. * 返回Ajax头信息
  50. *
  51. * @return void
  52. */
  53. if (!function_exists('AjaxHead')) {
  54. function AjaxHead()
  55. {
  56. @header("Pragma:no-cache\r\n");
  57. @header("Cache-Control:no-cache\r\n");
  58. @header("Expires:0\r\n");
  59. }
  60. }
  61. /**
  62. * 去除html和php标记
  63. *
  64. * @return string
  65. */
  66. if (!function_exists('dede_strip_tags')) {
  67. function dede_strip_tags($str)
  68. {
  69. $strs = explode('<', $str);
  70. $res = $strs[0];
  71. for ($i = 1; $i < count($strs); $i++) {
  72. if (!strpos($strs[$i], '>'))
  73. $res = $res . '&lt;' . $strs[$i];
  74. else
  75. $res = $res . '<' . $strs[$i];
  76. }
  77. return strip_tags($res);
  78. }
  79. }