JavaScript使用PHP函数 PHP extensions in JavaScript

php.js

php.js is an open source project that brings high-level PHP functions to low-level JavaScript platforms such as web browsers, browser extensions ( Mozilla/Firefox, Chrome ), AIR, and SSJS engines like V8 ( Node.js, v8cgi ), Rhino, and SpiderMonkey ( CouchDB )

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

xml

  • utf8_encode
  • utf8_decode

xdiff

  • xdiff_string_patch
  • xdiff_string_diff

var

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

url

  • urlencode
  • urldecode
  • rawurlencode
  • rawurldecode
  • parse_url
  • http_build_query
  • base64_encode
  • base64_decode

strings

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

pcre

  • sql_regcase
  • preg_quote

network

  • setrawcookie
  • setcookie
  • long2ip
  • ip2long
  • inet_pton
  • inet_ntop

net-gopher

  • gopher_parsedir

misc

  • uniqid
  • pack

math

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

json

  • json_last_error
  • json_encode
  • json_decode

info

  • version_compare
  • set_time_limit
  • ini_set
  • ini_get
  • getenv
  • assert_options

i18n

  • i18n_loc_set_default
  • i18n_loc_get_default

funchand

  • get_defined_functions
  • function_exists
  • create_function
  • call_user_func_array
  • call_user_func

filesystem

  • realpath
  • pathinfo
  • file_get_contents
  • dirname
  • basename

exec

  • escapeshellarg

datetime

  • time
  • strtotime
  • strptime
  • strftime
  • mktime
  • microtime
  • idate
  • gmstrftime
  • gmmktime
  • gmdate
  • gettimeofday
  • getdate
  • date_parse
  • date
  • checkdate

ctype

  • ctype_xdigit
  • ctype_upper
  • ctype_space
  • ctype_punct
  • ctype_print
  • ctype_lower
  • ctype_graph
  • ctype_digit
  • ctype_cntrl
  • ctype_alpha
  • ctype_alnum

bc

  • bcsub
  • bcscale
  • bcround
  • bcmul
  • bcdiv
  • bccomp
  • bcadd

array

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

主页:http://locutus.io/php/



原文/转自: JavaScript使用PHP函数 PHP extensions in JavaScript

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(JavaScript使用PHP函数 PHP extensions in JavaScript)