/phpJs

Primary LanguageJavaScript

js_for_php_function

js实现php函数库,方便php开发人员快速在js业务中快速使用已经熟悉的php函数库。 使用方式,直接引入

<script src="php.min.js"></script>
<script type="text/javascript">
    console.log(php.array_flip(
        {a: 1, b: 1, c: 2}
    ));
</script>

已经实现的函数库如下:

ctype

ctype_alnum
ctype_alpha
ctype_cntrl
ctype_digit
ctype_graph
ctype_lower
ctype_print
ctype_punct
ctype_space
ctype_upper
ctype_xdigit

misc

pack
time_sleep_until
uniqid

xdiff

xdiff_string_diff
xdiff_string_patch

strings

addcslashes
addslashes
bin2hex
chop
chr
chunk_split
convert_cyr_string
convert_uuencode
count_chars
crc32
echo
explode
get_html_translation_table
hex2bin
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
similar_text
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

bc

bcadd
bccomp
bcdiv
bcmul
bcround
bcscale
bcsub

array

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
foreach
in_array
key
krsort
ksort
natcasesort
natsort
next
pos
prev
range
reset
rsort
shuffle
sizeof
sort
uasort
uksort
usort

datetime

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

network

inet_ntop
inet_pton
ip2long
long2ip
setcookie
setrawcookie

var

doubleval
empty
floatval
gettype
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

filesystem

basename
dirname
file_get_contents
pathinfo
realpath

math

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

url

base64Library
base64_encode
get_headers
get_meta_tags
http_build_query
parse_url
rawurldecode
rawurlencode
urldecode
urlencode

xml

utf8_decode
utf8_encode

info

assert_options
getenv
getlastmod
ini_get
ini_set
set_time_limit
version_compare

json

json_decode
json_encode
json_last_error

funchand

call_user_func
call_user_func_array
create_function
function_exists
get_defined_functions

net-gopher

gopher_parsedir

exec

escapeshellarg

pcre

preg_grep
preg_quote
sql_regcase

i18n

i18n_loc_get_default
i18n_loc_set_default