Includes : Php

Php Functions

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/5167/18207/Includes%20%3A%20Php.js

  1. // ==UserScript==
  2. // @name Includes : Php
  3. // @namespace http://gm.wesley.eti.br/includes
  4. // @description Php Functions
  5. // @author w35l3y
  6. // @email w35l3y@brasnet.org
  7. // @copyright 2009, w35l3y (http://gm.wesley.eti.br/includes)
  8. // @license GNU GPL
  9. // @homepage http://gm.wesley.eti.br/includes
  10. // @version 1.0.2.0 BETA
  11. // @include nowhere
  12. // ==/UserScript==
  13.  
  14. /**************************************************************************
  15.  
  16. This program is free software: you can redistribute it and/or modify
  17. it under the terms of the GNU General Public License as published by
  18. the Free Software Foundation, either version 3 of the License, or
  19. (at your option) any later version.
  20.  
  21. This program is distributed in the hope that it will be useful,
  22. but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. GNU General Public License for more details.
  25.  
  26. You should have received a copy of the GNU General Public License
  27. along with this program. If not, see <http://www.gnu.org/licenses/>.
  28.  
  29. **************************************************************************/
  30.  
  31. function array_slice(arr, offs, len, preserve_keys)
  32. {
  33. var result = [];
  34. var at = arr.length;
  35. if (offs < 0)
  36. offs += at;
  37. if (typeof len == "undefined")
  38. len = at;
  39. len += offs;
  40.  
  41. for ( var ai = 0 ; ai < at ; ++ai )
  42. if (ai >= offs && ai <= len)
  43. if (preserve_keys)
  44. result[ai] = arr[ai];
  45. else
  46. result.push(arr[ai]);
  47.  
  48. return result;
  49. }
  50. function in_array(needle, haystack, strict)
  51. {
  52. for ( var key in haystack)
  53. if (strict && haystack[key] === needle || !strict && haystack[key] == needle)
  54. return true;
  55. return false;
  56. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址