设为首页 收藏本站
查看: 675|回复: 0

[经验分享] 超好用的 php.js (php_js)

[复制链接]

尚未签到

发表于 2017-3-4 11:27:23 | 显示全部楼层 |阅读模式
php.js
php.js is an open source project that brings high-level PHP functionsto low-level JavaScript platforms such as web browsers, browser extensions (Mozilla/Firefox, Chrome), AIR, and SSJSengines like V8 (node.js,v8cgi), Rhino, andSpiderMonkey (CouchDB)

If you want to perform high-level operations on these platforms,you probably need to write JS that combines its lower-level functions andbuild it up until you have something useful like: strip_tags(),strtotime(), number_format(),wordwrap().

Functions overview
  Here is a list of functions currently implemented by php.js.Missing functions can be found here.
Arrays

  • array
  • array_change_key_case
  • array_chunk
  • array_combine
  • array_count_values
  • array_diff
  • array_diff_assoc
  • array_diff_key
  • array_diff_uassoc
  • array_diff_ukey
  • array_fill
  • array_fill_keys
  • array_filter
  • array_flip
  • array_intersect
  • array_intersect_assoc
  • array_intersect_key
  • array_intersect_uassoc
  • array_intersect_ukey
  • array_key_exists
  • array_keys
  • array_map
  • array_merge
  • array_merge_recursive
  • array_multisort
  • array_pad
  • array_pop
  • array_product
  • array_push
  • array_rand
  • array_reduce
  • array_replace
  • array_replace_recursive
  • array_reverse
  • array_search
  • array_shift
  • array_slice
  • array_splice
  • array_sum
  • array_udiff
  • array_udiff_assoc
  • array_udiff_uassoc
  • array_uintersect
  • array_uintersect_assoc
  • array_uintersect_uassoc
  • array_unique
  • array_unshift
  • array_values
  • array_walk
  • array_walk_recursive
  • arsort
  • asort
  • compact
  • count
  • current
  • each
  • end
  • extract
  • in_array
  • key
  • krsort
  • ksort
  • natcasesort
  • natsort
  • next
  • pos
  • prev
  • range
  • reset
  • rsort
  • shuffle
  • sizeof
  • sort
  • uasort
  • uksort
  • usort
BCMath Arbitrary Precision Mathematics

  • bcadd
  • bccomp
  • bcdiv
  • bcmul
  • bcround
  • bcscale
  • bcsub
Character type checking

  • ctype_alnum
  • ctype_alpha
  • ctype_cntrl
  • ctype_digit
  • ctype_graph
  • ctype_lower
  • ctype_print
  • ctype_punct
  • ctype_space
  • ctype_upper
  • ctype_xdigit
Class/Object Information

  • class_alias
  • class_exists
  • get_class
  • get_class_methods
  • get_class_vars
  • get_declared_classes
  • get_object_vars
  • method_exists
  • property_exists
Classkit

  • classkit_import
  • classkit_method_add
  • classkit_method_copy
  • classkit_method_redefine
  • classkit_method_remove
  • classkit_method_rename
Date and Time

  • checkdate
  • date
  • date_default_timezone_get
  • date_default_timezone_set
  • date_parse
  • getdate
  • gettimeofday
  • gmdate
  • gmmktime
  • gmstrftime
  • idate
  • localtime
  • microtime
  • mktime
  • strftime
  • strptime
  • strtotime
  • time
  • timezone_abbreviations_list
  • timezone_identifiers_list
Error Handling and Logging

  • error_get_last
  • error_reporting
  • trigger_error
  • user_error
Filesystem

  • basename
  • dirname
  • fclose
  • feof
  • fgetc
  • fgetcsv
  • fgets
  • fgetss
  • file
  • file_exists
  • file_get_contents
  • filemtime
  • filesize
  • fopen
  • fpassthru
  • fread
  • fscanf
  • fseek
  • ftell
  • pathinfo
  • pclose
  • popen
  • readfile
  • realpath
  • rewind
Function Handling

  • call_user_func
  • call_user_func_array
  • create_function
  • forward_static_call
  • forward_static_call_array
  • func_get_arg
  • func_get_args
  • func_num_args
  • function_exists
  • get_defined_functions
  • register_shutdown_function
JavaScript Object Notation

  • json_decode
  • json_encode
  • json_last_error
Language & Control Structures

  • include
  • include_once
  • require
  • require_once
Mail

  • mail
Mathematical Functions

  • abs
  • acos
  • acosh
  • asin
  • asinh
  • atan
  • atan2
  • atanh
  • base_convert
  • bindec
  • ceil
  • cos
  • cosh
  • decbin
  • dechex
  • decoct
  • deg2rad
  • exp
  • expm1
  • floor
  • fmod
  • getrandmax
  • hexdec
  • hypot
  • is_finite
  • is_infinite
  • is_nan
  • lcg_value
  • log
  • log10
  • log1p
  • max
  • min
  • mt_getrandmax
  • mt_rand
  • octdec
  • pi
  • pow
  • rad2deg
  • rand
  • round
  • sin
  • sinh
  • sqrt
  • tan
  • tanh

Miscellaneous Functions

  • constant
  • define
  • defined
  • die
  • exit
  • pack
  • php_strip_whitespace
  • sleep
  • time_nanosleep
  • time_sleep_until
  • uniqid
  • usleep
Net Gopher

  • gopher_parsedir
Network

  • inet_ntop
  • inet_pton
  • ip2long
  • long2ip
  • setcookie
  • setrawcookie
Object Aggregation/Composition

  • aggregate
  • aggregate_info
  • aggregate_methods
  • aggregate_methods_by_list
  • aggregate_methods_by_regexp
  • aggregate_properties
  • aggregate_properties_by_list
  • aggregate_properties_by_regexp
  • aggregation_info
  • deaggregate
PHP Options and Information

  • assert
  • assert_options
  • get_cfg_var
  • get_defined_constants
  • get_extension_funcs
  • get_include_path
  • get_included_files
  • get_required_files
  • getenv
  • getlastmod
  • ini_alter
  • ini_get
  • ini_get_all
  • ini_restore
  • ini_set
  • php_ini_loaded_file
  • php_ini_scanned_files
  • phpversion
  • putenv
  • restore_include_path
  • set_include_path
  • set_time_limit
  • version_compare
Program execution Functions

  • escapeshellarg
Regular Expressions (Perl-Compatible)

  • preg_grep
  • preg_quote
  • sql_regcase
Streams

  • stream_context_create
  • stream_context_get_default
  • stream_context_get_options
  • stream_context_get_params
  • stream_context_set_default
  • stream_context_set_option
  • stream_context_set_params
  • stream_get_contents
  • stream_get_line
  • stream_is_local
Strings

  • addcslashes
  • addslashes
  • bin2hex
  • chop
  • chr
  • chunk_split
  • convert_cyr_string
  • convert_uuencode
  • count_chars
  • crc32
  • echo
  • explode
  • get_html_translation_table
  • html_entity_decode
  • htmlentities
  • htmlspecialchars
  • htmlspecialchars_decode
  • implode
  • join
  • lcfirst
  • levenshtein
  • localeconv
  • ltrim
  • md5
  • md5_file
  • metaphone
  • money_format
  • nl2br
  • nl_langinfo
  • number_format
  • ord
  • parse_str
  • printf
  • quoted_printable_decode
  • quoted_printable_encode
  • quotemeta
  • rtrim
  • setlocale
  • sha1
  • sha1_file
  • soundex
  • split
  • sprintf
  • sscanf
  • str_getcsv
  • str_ireplace
  • str_pad
  • str_repeat
  • str_replace
  • str_rot13
  • str_shuffle
  • str_split
  • str_word_count
  • strcasecmp
  • strchr
  • strcmp
  • strcoll
  • strcspn
  • strip_tags
  • stripos
  • stripslashes
  • stristr
  • strlen
  • strnatcasecmp
  • strnatcmp
  • strncasecmp
  • strncmp
  • strpbrk
  • strpos
  • strrchr
  • strrev
  • strripos
  • strrpos
  • strspn
  • strstr
  • strtok
  • strtolower
  • strtoupper
  • strtr
  • substr
  • substr_compare
  • substr_count
  • substr_replace
  • trim
  • ucfirst
  • ucwords
  • vprintf
  • vsprintf
  • wordwrap
URLs

  • base64_decode
  • base64_encode
  • get_headers
  • get_meta_tags
  • http_build_query
  • parse_url
  • rawurldecode
  • rawurlencode
  • urldecode
  • urlencode
Variable handling

  • doubleval
  • empty
  • floatval
  • get_defined_vars
  • get_resource_type
  • gettype
  • import_request_variables
  • intval
  • is_array
  • is_binary
  • is_bool
  • is_buffer
  • is_callable
  • is_double
  • is_float
  • is_int
  • is_integer
  • is_long
  • is_null
  • is_numeric
  • is_object
  • is_real
  • is_resource
  • is_scalar
  • is_string
  • is_unicode
  • isset
  • print_r
  • serialize
  • settype
  • strval
  • unserialize
  • var_dump
  • var_export
XML Parser

  • utf8_decode
  • utf8_encode
[internal] php.js shared libs
i18n

  • i18n_loc_get_default
  • i18n_loc_set_default
runkit

  • runkit_class_adopt
  • runkit_class_emancipate
  • runkit_function_add
  • runkit_function_copy
  • runkit_function_redefine
  • runkit_function_remove
  • runkit_function_rename
  • runkit_import
  • runkit_method_add
  • runkit_method_copy
  • runkit_method_redefine
  • runkit_method_remove
  • runkit_method_rename
  • runkit_superglobals
xdiff

  • xdiff_string_diff
  • xdiff_string_patch



 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-350139-1-1.html 上篇帖子: PHP 连接 SQL2008 下篇帖子: PHP常用模式
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表