PHP Common Cheat Sheet
|
array_filter (input, [callback])
|
|
array_key_exists (strtolower($key), array_change_key_case($search))
|
|
array_walk (&$array, callback(val,key), userdata)
|
|
array_map (callback, array1, [array2,...])
|
|
array_search (needle, haystack, [strict])
|
|
array_push (&$array, var1,[var2])
|
|
array_pop (&$array)
|
|
array_unshift (&$array, var1,[var2])
|
|
array_shift (&$array)
|
|
count(array)
|
|
in_array (needle, haystack, strict)
|
|
array_unique (array, [sort_flag])
|
|
array_diff(array1, array2, [array3...])
|
|
array_intersect(array1, array2, [array3...])
|
|
array_rand(array, [num])
|
|
substr_count (haystack, needle,[offset, length])
|
|
strpos (haystack, needle, [offset]) (compare only with ===)
|
|
stripos (haystack, needle, [offset])
|
|
strrpos (haystack, needle, [offset])
|
|
strripos (haystack, needle, [offset])
|
|
ord (symbol)
|
|
chr (ascii)
|
|
strip_tags (str, [allowable_tags])
|
|
number_format (number, decimals, dec.point, th. sep)
|
|
join (glue, array)
|
|
strstr (haystack, needle, [before_needle])
|
|
strlen (string)
|
|
parse_str (string, [& array])
|
|
flush ()
|
|
ceil()
|
|
floor()
|
|
round()
|
|
abs()
|
|
mt_rand([min=0, max=RAND_MAX])
|
|
r
|
read; pointer at start
|
|
r+
|
read/write; pointer at start
|
|
w
|
write; clean on start; create if not exists
|
|
w+
|
write/read; same
|
|
a
|
write; pointer at end; create if not exists
|
|
a+
|
write/read; pointer at end
|
|
x
|
write
|
|
x+
|
write/read
|
|
c
|
write
|
|
c+
|
write/read
|
|
is_dir (filename)
|
|
is_file (filename)
|
|
is_executable (filename)
|
|
is_link (filename)
|
|
is_writable (filename)
|
|
is_readable (filename)
|
|
file_exists (filename)
|
|
file_get_contents (filename,[include_path,resource,offset,maxlen])
|
|
disk_total_space (dir)
|
|
disk_free_space (dir)
|
|
dirname (path)
|
|
realpath (filename)
|
|
pathinfo (path [,PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME ] )
|
|
scandir(dir, [order])
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.