An Embeddable Scripting Engine |
|
|
List of built-in functions & constants.
The
following page enumerates all built-in Jx9 functions and constants.
As of this release, there are a total of 303 functions and over 139
constants.
A
full API reference guide will be available shortly. Meanwhile, if you need
a full description of a particular Jx9 function such as expected
number of arguments, purpose, return value, side effect and so forth
you can post one or more questions in the Jx9
forum or the Jx9
users mailing list.
C/C++ functions can be added easily using the foreign
function mechanism. To get the full list of defined functions
from your Jx9 script, simply call get_defined_functions() which
return a JSON array holding all installed functions.
Variable Handling functions.
is_bool
|
is_float
|
is_real
|
is_double
|
is_int
|
is_integer
|
is_long
|
is_string
|
is_null
|
is_numeric
|
is_scalar
|
is_array
|
is_object
|
is_resource
|
douleval |
floatval
|
intval
|
strval
|
empty
|
|
|
|
|
|
Special Virtual Machine functions.
json_encode
|
json_decode
|
func_num_args
|
func_get_arg
|
func_get_args
|
function_exists
|
is_callable
|
get_defined_functions
|
defined
|
get_defined_constants
|
print
|
die
|
exit
|
gettype
|
get_resource_type |
jx9_version
|
jx9_credits
|
jx9_info
|
jx9_copyright
|
getopt
|
utf8_encode
|
utf8_decode
|
include
|
import
|
JSON Arrays/Objects Processing functions.
sizeof
|
count
|
array_key_exists
|
array_pop
|
array_push
|
array_shift
|
array_product
|
array_sum
|
array_values
|
array_same
|
array_merge
|
array_diff
|
array_intersect
|
array_copy
|
key |
array_erase
|
array_map
|
array_walk
|
sort
|
rsort
|
usort
|
current
|
each
|
pos
|
next
|
prev
|
end
|
reset
|
extract
|
in_array
|
Math functions.
abs
|
sqrt
|
exp
|
floor
|
cos
|
sin
|
acos
|
asin
|
cosh
|
sinh
|
ceil
|
tan
|
tanh
|
atan
|
atan2
|
log
|
log10
|
pow
|
pi
|
fmod
|
hypot
|
round
|
dechex
|
decoct
|
decbin
|
hexdec
|
bindec
|
octdec
|
base_convert
|
min
|
max
|
rand
|
rand_str
|
getrandmax
|
|
|
String Processing functions.
substr
|
substr_compare
|
substr_count
|
chunk_split
|
htmlspecialchars
|
htmlspecialchars_decode
|
get_html_translation_table
|
htmlentities
|
html_entity_decode
|
strlen
|
strcmp
|
strcoll
|
strncmp
|
strcasecmp
|
strncasecmp
|
implode
|
join
|
implode_recursive
|
join_recursive
|
explode
|
trim
|
rtrim
|
chop
|
ltrim
|
strtolower
|
mb_strtolower
|
strtoupper
|
mb_strtoupper
|
ord
|
chr
|
bin2hex
|
strstr
|
stristr
|
strchr
|
strpos
|
stripos
|
strrpos
|
strripos
|
strrchr
|
strrev
|
str_repeat
|
nl2br
|
sprintf
|
printf
|
vprintf
|
vsprintf
|
size_format
|
str_getcsv
|
strip_tags
|
str_split
|
strspn
|
strcspn
|
strpbrk
|
soundex
|
wordwrap
|
strtok
|
str_pad
|
str_replace
|
str_ireplace
|
strtr
|
parse_ini_string
|
ctype_alnum
|
ctype_alpha
|
ctype_cntrl
|
ctype_digit
|
ctype_xdigit
|
ctype_graph
|
ctype_print
|
ctype_punct
|
ctype_space
|
ctype_lower
|
ctype_upper
|
Date/Time functions.
time
|
microtime
|
getdate
|
gettimeofday
|
date
|
strftime
|
idate
|
gmdate
|
localtime
|
mktime
|
gmmktime
|
|
URI Handling Functions.
convert_uuencode
|
convert_uudecode
|
urlencode
|
urldecode
|
rawurlencode
|
rawurldecode
|
idate
|
parse_url
|
|
|
|
|
hashing Functions.
md5
|
sha1
|
crc32
|
urldecode
|
base64_encode
|
base64_decode
|
md5_file
|
sha1_file
|
|
|
|
|
System (OS) Functions.
These functions are wrapper around the underlying Virtual File System VFS.
chdir
|
chroot
|
getcwd
|
rmdir
|
is_dir |
mkdir
|
rename
|
realpath
|
sleep
|
usleep
|
unlink
|
delete
|
chmod
|
chown
|
chgrp
|
disk_free_space
|
disk_total_space
|
file_exists
|
filesize
|
fileatime
|
filemtime
|
filectime
|
is_file
|
is_link
|
is_readable
|
is_writable
|
is_executable
|
filetype
|
stat
|
lstat
|
getenv
|
setenv
|
putenv
|
touch
|
link
|
symlink
|
umask
|
sys_get_temp_dir
|
get_current_user
|
getpid
|
getuid
|
getgid
|
uname
|
dirname
|
basename
|
pathinfo
|
strglob
|
fnmatch
|
tmpfile
|
scandir
|
glob
|
|
|
|
IO Stream Functions.
These functions are wrapper around the underlying IO Stream Device.
ftruncate
|
fseek
|
ftell
|
rewind
|
fflush
|
feof |
fgetc
|
fgets
|
fread
|
fgetcsv
|
fgetss
|
readdir
|
rewinddir
|
closedir
|
opendir
|
readfile
|
file_get_contents
|
file_put_contents
|
file
|
copy
|
fstat
|
fwrite
|
fputs
|
flock
|
fclose
|
fopen
|
fpassthru
|
fputcsv
|
fprintf
|
parse_ini_file
|
vfprintf
|
|
|
|
|
|
ZIP Processing Functions.
zip_open
|
zip_close
|
zip_read
|
zip_entry_open
|
zip_entry_close
|
zip_entry_name
|
zip_entry_filesize
|
zip_entry_compressedsize
|
zip_entry_read
|
zip_entry_reset_read_cursor
|
zip_entry_compressionmethod
|
|
Table of builtin constants.
Host
application defined constants can be added easily using the foreign
constant mechanism. To get the full list of defined constants
from your Jx9 script, simply call get_defined_constants() which
return a JSON array holding all installed constants.
JX9_VERSION
|
JX9_ENGINE
|
__JX9__
|
JX9_OS
|
__OS__
|
JX9_INT_MAX
|
JX9_EOL
|
MAXINT
|
JX9_INT_SIZE
|
PATH_SEPARATOR
|
DIRECTORY_SEPARATOR
|
DIR_SEP
|
__TIME__
|
__DATE__
|
__FILE__
|
__DIR__
|
COUNT_NORMAL
|
COUNT_RECURSIVE
|
SORT_ASC
|
SORT_DESC
|
SORT_REGULAR
|
SORT_NUMERIC
|
SORT_STRING
|
JX9_URL_SCHEME
|
JX9_URL_HOST
|
JX9_URL_PORT
|
JX9_URL_USER
|
JX9_URL_PASS
|
JX9_URL_PATH
|
JX9_URL_QUERY
|
JX9_URL_FRAGMENT
|
JX9_QUERY_RFC1738
|
JX9_QUERY_RFC3986
|
SEEK_SET
|
SEEK_CUR
|
SEEK_END
|
LOCK_EX
|
LOCK_SH
|
LOCK_NB
|
LOCK_UN
|
STDIN
|
stdin
|
STDOUT
|
stdout
|
STDERR
|
stderr
|
SCANDIR_SORT_ASC
|
SCANDIR_SORT_DESC
|
SCANDIR_SORT_NONE
|
GLOB_MARK
|
GLOB_NOSORT
|
GLOB_NOCHECK
|
GLOB_NOESCAPE
|
GLOB_BRACE
|
GLOB_ONLYDIR
|
GLOB_ERR
|
FILE_USE_INCL_PATH
|
FILE_IGN_NL
|
FILE_SKIP_EL
|
FILE_APPEND
|
and many more...
|
|
|
|
|
|