0% found this document useful (0 votes)
12 views

PHP Cheat Sheet [Updated] - Download PDF for Quick Reference

Uploaded by

Sup' Tan'
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

PHP Cheat Sheet [Updated] - Download PDF for Quick Reference

Uploaded by

Sup' Tan'
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

PHP Cheat Sheet

Posted in PHP (https://hackr.io/blog/category/php), Cheat Sheet (https://hackr.io/blog/category/cheat-sheet)

Barnali Chanda
(https://hackr.io/blog/author/barnali.sen)
Last Updated 10 Dec, 2020

Share:
(https://twitter.com/intent/tweet?text=PHP+Cheat+Sheet+https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fphp-

cheat-sheet) ( https://www.linkedin.com/shareArticle?mini=true&url=https://hackr.io/blog/php-cheat-sheet)

(http://www.reddit.com/submit?url=https://hackr.io/blog/php-cheat-sheet)

(https://news.ycombinator.com/submitlink?u=https://hackr.io/blog/php-cheat-sheet)

(https://api.whatsapp.com/send?text=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fphp-cheat-sheet)

Table of Contents 

Variable Handling Functions


Variables in PHP are containers for storing data.

A variable name is preceded with a $ sign.


It must start with a variable or an underscore.
A variable cannot be started with a number.
/
A variable can only contain alphanumeric characters.
Variables are case-sensitive. $Result and $result are treated as two di erent variables.

Variable Functions allow us to de ne, use and manipulate variables as required.

1. boolval Returns the boolean value of a variable.

2. debug_zval_dump Dumps the string representation of an internal zend value to output.

3. doubleval Alias of oatval.

4. empty Determines whether a variable is empty.

5. oatval Returns the Float Value of a variable.

6. get_de ned_vars Returns an Array of all de ned variable.

7. get_resource_type Returns the resource type.

8. gettype Returns the type of a variable.

9. import_request_variables Imports GET/POST/Cookie variables into the resource type.

10. intval Get the integer value of the variable.

11. is_array Determines whether the variable is an array

12. is_bool Determines whether a variable is Boolean

13. is_callable Veri es if the contents of a variable can be called a function.

14. is_ oat | is double | is_real Determines whether the type of a variable is ‘ oat’.

15. is_int| is_integer | is_long Determines whether the type of variable is an integer.

16. is_null Determines whether a variable is NULL

17. is_numeric Determines whether a variable is a number or a numeric string.

18. is_object Determines whether a variable is an object.

/
19. is_resource Determines whether a variable is a resource.

20. is_scalar Determines whether a variable is scalar.

21. is_string Determines whether the type of variable is string.

22. isset Determines if a variable is set and not NULL.

23. print_r Prints information in human readable format.

24. serialize Generates a storable representation of a value.

25. settype Set the type of a variable.

26. strval Get the string value of a variable.

27. unserialize Creates a PHP value of a stored variable.

28. Unset Unsets a given variable

29. var_dump Dumps information about a variable.

30. var_export Outputs or returns a parsable string representation of a variable.

Array Functions
An array is used to store a list of values in one single variable. The values can be accessed by referring
to an index number which always starts with 0. Arrays can be:

Indexed: Default Array Format. Values can be accessed by index number.


Associative: Use named keys.
Multidimensional: Can also be referred as a matrix. It contains one or more arrays. You can also think
of it as a nested array.

Array Functions allow us to de ne, store, traverse data and information as required.

1. array() Declares and creates an Array.

array_change_key_case(
2. Returns an array with all keys in lowercase or uppercase.
)

3. array_chunk() Splits an array into chunks of Array.


/
4. array_combine() Creates an array by using one array for keys and one for values.

5. array_count_values() Returns an array with the number of occurrences for each value.

6. array_di () Compares array values and returns the di erences.

7. array_di _assoc() Compares array key and values and returns the di erences.

8. array_di _key() Compares array keys and returns the di erences.

Compares array keys and values, with an additional user made


9. array_di _uassoc()
function check, and returns the di erences.

Compares array keys, with an additional user made function check,


10. array_di _ukey()
and returns the di erences.

11. array_ ll() Fills an array with values.

12. array_ lter() Filters elements of an array through a user-made function.

13. array_ ip() Exchanges all keys with their associated values in the array.

14. array_intersect() Compares array values and returns the matches

15. array_intersect_assoc() Compares array keys and values and returns the matches.

16. array_intersect_key() Compares array keys and returns the matches.

Compares keys and values, with an additional user-made function


17. array_intersect_uassoc()
check and return the matches.

Compares the keys, with an additional user-made function check and


18. array_intersect_ukey()
return the matches.

19. array_key_exists() Determines if the speci ed keys exists in the array.

20. array_keys() Returns all keys of an array.

Send each value of an array to a user-made function, which returns


21. array_map()
new values.

/
array_merge() |
22. Merges one or more arrays into one array.
array_merge_recursive()

23. array_multisort() Sorts multiple or multi-dimensional arrays.

Inserts a speci ed number of items, with a speci ed value, to an


24. array_pad()
array.

25. array_pop() Deletes the last element of an array.

26. array_product() Calculates the product of the values in an array.

27. array_push() Inserts one or more elements to the end of an array.

28. array_rand() Returns one or more random keys from an array.

29 array_reduce() Returns an array as a string, using a user de ned function.


.

30. array_reverse() Returns an array in the reverse order.

31. array_search() Searches an array for a given value and returns the key.

Removes the rst element from an array, and returns the value of the
32. array_shift()
removed element.

33. array_slice() Removes and replaces speci ed elements of an array.

34. array_splice() Removes and replaces speci ed elements of an array

35. array_sum() Returns the sum of the values in an array.

36. array_udi () Compares array values in a user-made function and returns an array.

Compares array keys, and compares array values in a user-made


37. array_udi _assoc()
function, and returns an array.

Compares array keys and array values in user-made functions, and


38. array_udi _uassoc()
returns an array.

/
39. array_uintersect() Compares array values in a user-made function and returns an array.

Compares array keys, and compares array values in a user-made


40. array_uintersect_assoc()
function, and returns an array.

array_uintersect_uassoc( Compares array keys and array values is user-made functions, and
41.
) returns an array.

42. array_unique() Removes duplicate values from an array.

43. array_unshift() Adds one or more elements to the beginning of an array.

44. array_values() Returns all the values of an array.

45. array_walk() Applies a user function to every member of an array.

46. array_walk_recursive() Applies a user function recursively to every member of an array.

47. arsort() Sorts an array in reverse order and maintains index association.

48. asort() Sorts an array and maintains index association.

49. compact() Create array containing variables and their values.

50. count() Counts elements in an array, or properties in an object.

51. current() Returns the current element in an array

52. each() Returns the current key and value pair from an array

53. end() Sets the internal pointer of an array to its last element.

54. extract() Imports variables into the current symbol table from an array.

55. in_array() Checks if a speci ed value exists in an array.

56. key() Fetches a key from an array.

57. krsort() Sorts an array by key in reverse order.

58. ksort() Sorts an array by key.

/
59. list() Assigns variables as if they were an array.

60. natcasesort() Sorts an array using a case insensitive.

61. natsort() Sorts an array

62. next() Advance the internal array pointer of an array

63. pos() Alias of current.

64. prev() Rewinds the internal array pointer.

65. range() Creates an array containing a range of elements.

66. reset() Sets the internal pointer of an array to its rst element.

67. rsort() Sorts an array in reverse order.

68. shu e() Shu es an array

69. sizeof() Alias of count()

70. sort() Sorts an array

Sorts an array with a user-de ned function and maintain index


71. uasort()
association.

72. uksort() Sorts an array by keys using a user-de ned function

73. usort() Sorts an array by values using a user-de ned function.

Array Constants
Used with array_change_key_case() to convert array keys to
1. CASE_LOWER
lowercase

Used with array_change_key_case() to convert array keys to


2. CASE_UPPER
uppercase

3.
SORT_ASC Used with array_multisort() to sort in ascending order

/
4. SORT_DESC Used with array_multisort() to sort in descending order

5. SORT_REGULAR Used to compare items normally

6. SORT_NUMERIC Used to compare items numerically

7. SORT_STRING Used to compare items as strings

Used to compare items as strings, based on the current


8. SORT_LOCALE_STRING
locale

9. COUNT_NORMAL Counts all elements in an array.

10
COUNT_RECURSIVE Recursively counts the elements in an array.
.

Imports variables from an array into the current symbol


11. EXTR_OVERWRITE
table.

12 It is an extraction ag. If there is a collision, do not overwrite


EXTR_SKIP
. the existing variable.

13
EXTR_PREFIX_SAME If there is a collision, pre x the variable name with pre x.
.

14
EXTR_PREFIX_ALL Pre x all variable names with pre x.
.

15
EXTR_PREFIX_INVALID Only pre x invalid/numeric variable names with pre x.
.

Only create pre xed variable names if the non-pre xed


16
EXTR_PREFIX_IF_EXISTS version of the same variable exists in the current symbol
.
table.

/
Only overwrite the variable if it already exists in the current
symbol table, otherwise do nothing. This is useful for
17. EXTR_IF_EXISTS
de ning a list of valid variables and then extracting only
those variables de ned out of $_REQUEST.

Extracts variables as references. This means the values of


18
EXTR_REFS the imported variables are still referencing the values of the
.
array parameter.

String Functions
Strings are a sequence of characters. It is a data type. It can be alphanumeric as well. Strings are created
by declaring a variable and assigning string characters to it. String Functions allow us to manipulate and
handle strings as required.

Returns a string with backslashes in front of the


1. addcslashes()
speci ed characters.

Returns a string with backslashes in front of


2. addslashes()
prede ned characters.

Converts a string of ASCII characters to


3. bin2hex()
hexadecimal values.

4. chop() Alias of rtrim()

Returns a character from a speci ed ASCII


5. chr()
value.

6. chunk_split() Split a string into a series of smaller parts.

Converts a string from one Cyrillic character-


7. convert_cyr_string()
set to another.

8. convert_uudecode() Decodes a uuencoded string.

Encodes a string using the uuencode


9. convert_uuencode()
algorithm.

/
Returns how many times an ASCII character
10. count_chars() occurs within a string and returns the
information.

11. crc32() Calculates a 32-bit CRC for a string.

12. crypt() One-way string encryption (hashing)

13. echo() Outputs strings

14. explode() Breaks a string into an array.

Writes a formatted string to a speci ed output


15. fprintf()
stream.

Returns the translation table used by


16. get_html_translation_table()
htmlspecialchars() and htmlentities()

17. hebrev() Converts Hebrew text to visual text.

Converts Hebrew text to visual text and new


18. hebrevc()
lines(\n) into <br/>

19. html_entity_decode() Converts HTML entities to characters.

20. htmlentities() Converts characters to HTML entities.

Converts some prede ned HTML entities to


21. htmlspecialchars_decode()
characters.

Converts some prede ned characters to HTML


22. htmlspecialchars()
entities.

23. implode() Returns a string from the elements of an array.

24. join() Alias of implode()

Returns the Levenshtein distance between two


25. levenshtein()
strings.

Returns locale numeric and monetary


26. localeconv()
formatting information.
/
27. ltrim() Strips whitespaces from the left side of a string.

28. md5() Calculates the md5 hash of a string.

29. md5_ le() Calculates the md5 hash of a le.

30. metaphone() Calculates the metaphone key of a string.

31. money_format() Returns a string formatted as a currency string.

32. nl_langinfo() Returns a speci c local information.

Inserts HTML line breaks in front of each


33. nl2br()
newline in a string.

34. number_format() Formats a number with grouped thousands.

Returns the ASCII value of the rst character of


35. ord()
a string.

36. parse_str() Parses a query string into variables.

37. print() Outputs a string.

38. printf() Outputs a formatted string.

39. quoted_printable_decode() Decodes a quoted-printable string.

40. quotemeta() Quotes meta-characters.

Strips whitespace from the right side of a


41. rtrim()
string.

42. setlocale() Sets locale information.

43. sha1() Calculates the SHA-1 hash of a string.

44. sha1_ le() Calculates the SHA-1 hash of a le.

45. similar_text() Calculates the similarity between two strings.

/
46. soundex() Calculates the soundex key of a string

47. sprintf() Writes a formatted string to a variable.

Parses input from a string according to a


48. sscanf()
format.

Replaces some characters in a string(case-


49. str_ireplace()
insensitive)

50. str_pad() Pads a string to a new length.

51. str_repeat() Repeats a string a speci ed number of times.

Replaces some characters in a string(case-


52. str_replace()
sensitive)

53. str_rot13() Performs the ROT13 encoding on a string.

54. str_shu e() Randomly shu es all characters in a string.

55. str_split() Splits a string into an array.

56. str_word_count() Count the number of words in a string.

57. strcasecmp() Compares two strings (case-insensitive)

Finds the rst occurrence of a string inside


58. strchr()
another string (alias of strstr())

59. strcmp() Compares two strings (case-sensitive)

60. strcoll() Locale based string comparison

Returns the number of characters found in a


61. strcspn() string before any part of some speci ed
characters are found.

62. strip_tags() Strips HTML and PHP tags from a string.

63. stripcslashes() Unquotes a string quoted with addcslashes()

/
64. stripslashes() Unquotes a string quoted with addslashes()

Returns the position of the rst occurrence of a


65. stripos()
string inside another string (case-insensitive)

Finds the rst occurrence of a string inside


66. stristr()
another string(case-insensitive)

67. strlen() Returns the length of a string

68. strnatcasecmp() Compares two strings

69. strnatcmp() Compares two strings

String comparison of the rst n characters


70. strncasecmp()
(case -insensitive)

String comparison of the rst n characters


71. strncmp()
(case – sensitive)

72. strpbrk() Searches a string for any of a set of characters.

Returns the position of the rst occurrence of a


73. strpos()
string inside another string(case-sensitive)

Finds the last occurrence of a string inside


74. strrchr()
another string.

75. strrev() Reverses a string

Finds the position of the last occurrence of a


76. strripos()
string inside another string(case-insensitive)

Finds the position of the last occurrence of a


77. strrpos()
string inside another string (case – sensitive)

Returns the number of characters found in a


78. strspn() string that contains only characters from a
speci ed charlist.

Finds the rst occurrence of a string inside


79. strstr()
another string(case-sensitive)
/
78. strtok() Splits a string into smaller strings.

79. strtolower() Converts a string to lowercase letters.

80. strtoupper() Converts a string to uppercase letters.

81. strtr() Translates certain characters in a string.

82. substr() Returns a part of a string.

Compares two strings from a speci ed start


83. substr_compare() position (binary safe and optionally case-
sensitive)

Counts the number of times a substring occurs


84. substr_count()
in a string.

85. substr_replace() Replaces a part of a string with another string.

86. trim() Strips whitespace from both sides of a string.

Converts the rst character of a string to


87. uc rst()
uppercase.

Converts the rst character of each word in a


88. ucwords()
string to uppercase.

Writes a formatted string to a speci ed output


89. vfprintf()
stream.

90. vprintf() Outputs a formatted string.

91. vsprintf() Writes a formatted string to a variable.

92. wordwrap() Wraps a string to a given number of characters.

String Constants

/
CRYP
T_SA
1 Contains the length of the default encryption method for the system. For standard DES
LT_LE
. encryption, the length is 2
NGT
H

CRYP
2 T_ST Set to 1 if the standard DES-based encryption with a 2 character salt is supported, 0
. D_DE otherwise
S

CRYP
3 T_EX Set to 1 if the extended DES-based encryption with a 9 character salt is supported, 0
. T_DE otherwise
S

CRYP
4 Set to 1 if the MD5 encryption with a 12 character salt starting with $1$ is supported, 0
T_MD
. otherwise
5

CRYP
5 T_BL Set to 1 if the Blow sh encryption with a 16 character salt starting with $2$ or $2a$ is
. OWFI supported, 0 otherwise
SH

HTML
_SPE
6
CIAL Converts some prede ned characters to HTML entities.
.
CHAR
S

HTML
7
_ENTI Converts a special character in an input string into the form of an HTML character.
.
TIES

ENT_
8
COM Converts double quotes
.
PAT

ENT_
9
QUO Will convert both single and double quotes.
.
TES

/
ENT_
1
NOQ
0 Will leave both single and double quotes unconverted.
UOTE
.
S

1 ENT_I
Silently discard invalid code unit sequences instead of returning an empty string. Using this
1 GNO
ag is discouraged as it may have security implications.
. RE

ENT_
1
SUBS Replace invalid code unit sequences with a Unicode Replacement Character U+FFFD (UTF-
2
TITUT 8) or &#xFFFD; (otherwise) instead of returning an empty string.
.
E

ENT_ Replace invalid code points for the given document type with a Unicode Replacement
1
DISAL Character U+FFFD (UTF-8) or &#xFFFD; (otherwise) instead of leaving them as is. This may
3
LOWE be useful, for instance, to ensure the well-formedness of XML documents with embedded
.
D external content.

1 ENT_
4 HTML Handle code as HTML 4.01.
. 401

1
ENT_
5 Handle code as XML 1.
XML1
.

1 ENT_
6 XHT Handle code as XHTML.
. ML

1 ENT_
7 HTML Handle code as HTML 5.
. 5

1
CHAR
8 If an array element is equal to CHAR_MAX, no further grouping is done.
_MAX
.

1
LC_C
9 For character classi cation and conversion.
TYPE
.

/
2 LC_N
0 UMER Used for decimal separator.
. IC

2
LC_TI
1 For date and time formatting.
ME
.

2 LC_C
2 OLLA For string comparison.
. TE

2 LC_M
3 ONET For localeconv()
. ARY

2
LC_A
4 For all LC_ functions.
LL
.

2 LC_M
5 ESSA For system responses.
. GES

2 STR_
6 PAD_ Pad left side of an input string.
. LEFT

STR_
2
PAD_
7 Pad right side of an input string.
RIGH
.
T

2 STR_
8 PAD_ Pad both sides of an input string.
. BOTH

Math Functions
Math functions are used to handle values within the range of integer and oat types.

1. abs() Returns the absolute value of a number.

/
2. acos() Returns the arccosine of a number.

3. acosh() Returns the inverse hyperbolic cosine of a number.

4. asin() Returns the arcsine of a number.

5. asinh() Returns the inverse hyperbolic sine of a number.

Returns the arctangent of a number as a numeric value


6. atan()
between: -pi/2 and +pi/2 radians.

Returns the angle theta of an (x,y) point as a numeric value


7. atan2()
between -pi and +pi radians.

8. atanh() Returns the inverse hyperbolic tangent of a number.

9. base_convert() Converts a number from one base to another.

10. bindec() Converts a binary number to a decimal number.

Returns the value of a number rounded upwards to the


11. ceil()
nearest integer.

12. cos() Returns the cosine of a number.

13. cosh() Returns the hyperbolic cosine of a number.

14. decbin() Converts a decimal number to a binary number.

15. dechex() Converts a decimal number to a hexadecimal number.

16. decoct() Converts a decimal number to an octal number.

17. deg2rad() Converts a degree to a radian number.

18. exp() Returns the value of E

19. expm1() Returns the value of E

Returns the value of a number rounded downwards to the


20. oor()
nearest integer.

/
Returns the remainder(modulo) of the division of the
21. fmod()
arguments.

Returns the maximum random number that can be returned by


22. getrandmax()
a call to the rand() function.

23. hexdec() Converts a hexadecimal number to a decimal number.

24. hypot() Returns the length of the hypotenuse of a right-angle triangle.

25. is_ nite() Returns true if a value is a nite number.

26. is_in nite() Returns true if a value is an in nite number.

27. is_nan() Returns true if a value is not a number

28. lcg_value() Returns a pseudo random number in the range of (0,1)

29. log() Returns the natural logarithm(base E) of a number.

30. log10() Returns the base-10 logarithm of a number.

31. log1p() Returns log(1+number)

Returns the number with the highest value of two speci ed


32. max()
numbers.

Returns the number with the lowest value of two speci ed


33. min()
numbers.

Returns the largest possible value that can be returned by


34. mt_getrandmax()
mt_rand()

35. mt_rand() Returns a random integer using Mersenne Twister algorithm.

36. mt_srand() Seeds the Mersenne Twister random number generator.

37. octdec() Converts an octal number to a decimal number.

38. pi() Returns the value of pi

/
39. pow() Returns the value is x to the power of y.

40. rad2deg() Converts a radian number to a degree

41. rand() Returns a random integer

42. round() Rounds a number to the nearest integer.

43. sin() Returns the sine of a number.

44. sinh() Returns the hyperbolic sine of a number.

45. sqrt() Returns the sqrt of a number.

46. srand() Seeds the random number generator.

47. tan() Returns the tangent of an angle.

48. tanh() Returns the hyperbolic tangent of an angle.

Math Constants
1. M_E Returns e (approx. 2.718)

2. M_EULER Returns Euler's constant (approx. 0.577)

3. M_LNPI Returns the natural logarithm of PI (approx. 1.144)

4. M_LN2 Returns the natural logarithm of 2 (approx. 0.693)

5. M_LN10 Returns the natural logarithm of 10 (approx. 2.302)

6. M_LOG2E Returns the base-2 logarithm of E (approx. 1.442)

7. M_LOG10E Returns the base-10 logarithm of E (approx. 0.434)

8. M_PI Returns PI (approx. 3.14159)

9. M_PI_2 Returns PI/2 (approx. 1.570)

10. M_PI_4 Returns PI/4 (approx. 0.785)


/
11. M_1_PI Returns 1/PI (approx. 0.318)

12. M_2_PI Returns 2/PI (approx. 0.636)

13. M_SQRTPI Returns the square root of PI (approx. 1.772)

14. M_2_SQRTPI Returns 2/square root of PI (approx. 1.128)

15. M_SQRT1_2 Returns the square root of 1/2 (approx. 0.707)

16. M_SQRT2 Returns the square root of 2 (approx. 1.414)

18 M_SQRT3 Returns the square root of 3 (approx. 1.732)

Date/Time Functions
The date/time functions allow getting the date and time from the server where the PHP script runs.
These functions can also be used to format date/time functions as required.

1. checkdate() Validates a Gregorian Data

2. date_default_timezone_get() Returns the default time zone.

3. date_default_timezone_set() Sets the default time zone.

Returns the time of sunrise for the time or


4. date_sunrise()
location.

Returns the time of sunset for the time or


5. date_sunset()
location.

6. date() Formats a local time/date.

Returns an array that contains the date and


7. getdate()
time stamp information for a Unix timestamp.

Returns an array that contains the current time


8. gettimeofday()
information.

9. gmdate() Formats a GMT/UTC date/time

10. gmmktime() Returns the Unix timestamp for a GMT Table.


/
Formats a GMT/UTC time/date according to
11. gmstrftime()
locale settings.

12. idate() Formats a local time/date as an integer.

Returns an array that contains the time


13. localtime()
components of a Unix Timestamp.

14. microtime() Returns the current time in microseconds.

15. mktime() Returns the Unix timestamp for a date.

Formats the local time date according to


16. strftime()
locale settings.

17. strptime() Parses a time/date generated with strftime()

Parses English textual date or time into a Unix


18. strtotime()
timestamp.

19 time() Returns the current time as a Unix timestamp.

Date/Time Constants
1. DATE_ATOM Atom (example: 2005-08-15T16:13:03+0000)

2. DATE_COOKIE HTTP Cookies (example: Sun, 14 Aug 2005 16:13:03 UTC)

3. DATE_ISO8601 ISO-8601 (example: 2005-08-14T16:13:03+0000)

4. DATE_RFC822 RFC 822 (example: Sun, 14 Aug 2005 16:13:03 UTC)

5. DATE_RFC850 RFC 850 (example: Sunday, 14-Aug-05 16:13:03 UTC)

6. DATE_RFC1036 RFC 1036 (example: Sunday, 14-Aug-05 16:13:03 UTC)

7. DATE_RFC1123 RFC 1123 (example: Sun, 14 Aug 2005 16:13:03 UTC)

8. DATE_RFC2822 RFC 2822 (Sun, 14 Aug 2005 16:13:03 +0000)

9. DATE_RSS RSS (Sun, 14 Aug 2005 16:13:03 UTC)

/
World Wide Web Consortium (example: 2005-08-
10. DATE_W3C
14T16:13:03+0000)

Calendar Functions
The Calendar extension contains functions that simplify the conversion between two di erent calendar
formats.

cal_days_in_mont
1. Returns the number of days in a month for a speci ed year and calendar
h()

2. cal_from_jd() Converts a Julian day count into a date of a speci ed calendar.

3. cal_info() Returns information about a given calendar

4. cal_to_jd() Converts a date to Julian day count.

5. easter_date() Returns the Unix timestamp for midnight on Easter of a speci ed month.

Returns the number of days after March 21, on which Easter falls for a
6. easter_days()
speci ed year.

7. FrenchToJD() Converts a French Republican date to a Julian day count.

8. GregorianToJD() Converts a Gregorian Date to a Julian day count.

9. JDDayOfWeek() Returns the day of the week.

10
JDMonthName() Returns a month name.
.

11. JDToFrench() Converts a Julian day count to a French Republican date.

12
JDToGregorian() Converts a Julian day count to a Gregorian Date.
.

13
jdtojewish() Converts a Julian day count to a Jewish date.
.

14
JDToJulian() Converts a Julian day count to a Julian date.
.

/
15
jdtounix() Converts a Julian day count to a Unix timestamp.
.

16
JewishToJD() Converts a Jewish date to a Julian day count.
.

17. JulianToJD() Converts a Julian date to a Julian day count.

18
unixtojd() Converts a Unix timestamp to a Julian day count.
.

Calendar Constants
1. CAL_GREGORIAN Gregorian Calendar

2. CAL_JULIAN Julian Calendar

3. CAL_JEWISH Jewish Calendar

4. CAL_FRENCH French Republican Calendar.

The number of available


5. CAL_NUM_CALS
calendars.

The day of the week as integer,


6. CAL_DOW_DAYNO where 0 means Sunday and 6
means Saturday.

The abbreviated English name of


7. CAL_DOW_SHORT
the day of the week.

The English name of the day of


8. CAL_DOW_LONG
the week.

The abbreviated Gregorian


9. CAL_MONTH_GREGORIAN_SHORT
month name.

10. CAL_MONTH_GREGORIAN_LONG The Gregorian month name.

The abbreviated Julian month


11. CAL_MONTH_JULIAN_SHORT
name.

/
12. CAL_MONTH_JULIAN_LONG The Julian month name.

13. CAL_MONTH_JEWISH The Jewish month name.

The French Republican month


14. CAL_MONTH_FRENCH
name.

Calculate Easter for years before


1753 according to the Julian
15. CAL_EASTER_DEFAULT calendar, and for later years
according to the Gregorian
calendar.

Calculate Easter for years before


1583 according to the Julian
16. CAL_EASTER_ROMAN calendar, and for later years
according to the Gregorian
calendar.

Calculate Easter according to


17. CAL_EASTER_ALWAYS_GREGORIAN
the proleptic Gregorian calendar.

Calculate Easter according to


18. CAL_EASTER_ALWAYS_JULIAN
the Julian calendar.

Adds a geresh symbol (which


resembles a single-quote mark)
19. CAL_JEWISH_ADD_ALAFIM_GERESH
as thousands separator to the
year number.

Adds the word ala m as


20. CAL_JEWISH_ADD_ALAFIM thousands separator to the year
number.

Add a gershayim symbol (which


resembles a double-quote mark)
21. CAL_JEWISH_ADD_GERESHAYIM
before the nal letter of the day
and year numbers.

Directory Functions
The directory functions are used to retrieve information about directories and their contents.

/
1. chdir() Changes the current directory

2. chroot() Changes the root directory to the current process.

3. dir() Opens the directory handle and returns an object.

4. closedir() Closes the directory handle.

5. getcwd() Returns the current directory.

6. opendir() Open a directory handle.

7. readdir() Returns an entry from the directory handle.

8. rewinddir() Resets a directory handle.

9. scandir() Lists the les and directory inside a speci ed path.

Directory Constants
DIRECTORY
1 In di erent OS there is di erent directory separator. In Windows it's \ in Linux it's /.
_SEPARATO
. DIRECTORY_SEPARATOR is constant with that OS directory separator.
R

2 PATH_SEPA
Semicolon on windows, colon otherwise.
. RATOR

File System Functions


These functions allow to access and manipulate the lesystem.

1. basename() Returns the lename component of a path.

2. chgrp() Changes the le group.

3. chmod() Changes the le mode

4. chown() Changes the le owner

5. clearstatcache() Clears the le status cache

6. copy() Copies a le
/
7. delete() Delete a le

8. dirname() Returns the directory name component of a path

9. disk_free_space() | diskfreespace() Returns the free space of a directory

10. disk_total_space() Returns the total size of a directory

11. fclose() Closes an open le

12. feof() Tests for end-of- le on an open le

13. ush() Flushes bu ered output to an open le.

14. fgetc() Returns a character from an open le

15. fgetcsv() Checks and parses a line in an open le.

16. fgets() Returns a line from an open le.

Returns a line, with HTML and PHP tags removed,


17. fgetss()
from an open le.

18. le() Reads a le into an array

19. le_exists() Checks whether or not a le or a directory exists.

20. le_get_contents() Reads a le into a string

21. le_put_contents Writes a string to a le

22. leatime() Returns the last access time of a le

23. lectime() Returns the last change time of a le.

24. legroup() Returns the group ID of a le

25. leinode() Returns the inode number of a le

26. lemtime() Returns the last modi cation time of a le

/
27. leowner() Returns the user ID(owner) of a le

28. leperms() Returns the permissions of a le.

29. lesize() Returns the le size.

30. letype() Returns the le type.

31. ock() Locks or releases a le.

Matches a lename or string against a speci ed


32. fnmatch()
pattern

33. fopen() Opens a le or URL

Reads from an open le, until EOF, and writes the


34. fpassthru()
result to the output bu er.

35. fputcsv() Formats a line as CSV and writes it to an open le.

36. fputs() Alias of fwrite.

37. fread() Reads from an open le.

Parses input form an open le according to a


38. fscanf()
speci ed format.

39. fseek() Seeks in an open le.

40. fstat() Returns information about an open le.

41. ftell() Returns the current position in an open le.

42. ftruncate() Truncates an open le to a speci ed length.

43. fwrite() Writes to an open le.

Returns an array of lenames/directories matching


44. glob()
a speci ed pattern.

45. is_dir() Checks whether a le is a directory.

/
46. is_executable() Checks whether a le is executable.

47. is_ le() Checks whether a le is a regular le.

48. is_link() Check whether a le is a link.

49. is_readable() Checks whether a le is readable.

Checks whether a le was uploaded via HTTP


50. is_uploaded_ le()
POST

51. is_writable()|is_writeable() Checks whether a le is readable.

52. link() Creates a hard link

53. linkinfo() Returns information about a hard link.

54. lstat() Returns information about a le or symbolic link

55. mkdir() Creates a directory.

56. move_uploaded_ le() Moves an uploaded le to a new location.

57. parse_ini_ le() Parses a con guration le.

58. pathinfo() Returns information about a le path.

59. pclose() Closes a pipe opened by popen()

60. popen() Opens a pipe

61. read le() Reads a le and writes it to the output bu er.

62. readlink() Returns the target of a symbolic link.

63. realpath() Returns the absolute pathname.

64. rename() Renames a le or directory.

65. rewind() Rewinds a le pointer.

/
66. rmdir() Removes an empty directory.

67. set_ le_bu er() Sets the bu er size if an open le.

68. stat() Returns information about a le.

69. symlink() Creates a symbolic link

70. tempnam() | tmp le() Creates a unique temporary le

71. touch() Sets access and modi cation time of a le.

72. umask() Changes le permissions for les.

73. unlink() Deletes a le.

File System Constants


1
GLOB_BRACE Expands to match 'a', 'b', or 'c'
.

2
GLOB_ONLYDIR Return only directory entries which match the pattern
.

3
GLOB_MARK Adds a slash to each directory returned
.

4 Return les as they appear in the directory (no sorting). When this ag is not
GLOB_NOSORT
. used, the path names are sorted alphabetically

5 GLOB_NOCHEC
Return the search pattern if no les matching it were found
. K

6 GLOB_NOESCA
Backslashes do not quote metacharacters.
. PE

7
GLOB_ERR Stop on read errors (like unreadable directories), by default errors are ignored.
.

8 PATHINFO_DIRN
Returns information about the path directory.
. AME

/
9 PATHINFO_BAS
Returns information about the path basename.
. ENAME

1
PATHINFO_EXT
0 Returns information about the path extension.
ENSION
.

1
FILE_USE_INCL
1 Search for the le in the include path.
UDE_PATH
.

1
2 FILE_APPEND Append a le to a le. The target le needs to be writable for this.
.

1
FILE_IGNORE_N
3 Omit newline at the end of each array element.
EW_LINES
.

1
FILE_SKIP_EMP
4 Skips empty lines.
TY_LINES
.

Zip Functions
These functions allow you to read zip les. The ZIP extension requires libzip which is a C library for
reading, creating and modifying zip archives.

1. zip_close() Closes a ZIP File

2. zip_entry_close() Closes an entry in the ZIP le

3. zip_entry_compressedsize() Returns compressed size of an entry in the ZIP le.

4. zip_entry_compressionmethod() Returns the compression method of an entry in the ZIP File.

5. zip_entry_ lesize() Returns the actual le size of an entry in the ZIP File.

6. zip_entry_name() Returns the name of an entry in the ZIP File.

7. zip_entry_open() Opens an entry in the ZIP File for reading.

/
8. zip_entry_read() Reads from an open entry in the ZIP File.

9. zip_open() Opens a ZIP File

10. zip_read() Reads the next entry in the ZIP File.

Filter Functions
These functions are used to validate and lter data coming from insecure input sources. These lter
functions are enabled by default.

1. lter_has_var() Checks if a variable of a speci ed input type exist.

2. lter_id() Returns the ID number of a speci ed lter.

3. lter_input() Get input from outside the script and lter it.

4. lter_input_array() Get multiple inputs from outside the script and lters them.

5. lter_list() Returns an array of all supported lters

6. lter_var_array() Get multiple variables and lter them.

7. lter_var() Get a variable and lter it.

Filter Constants

Do nothing, optionally strip/encode


1. FILTER_DEFAULT special characters. Equivalent to
FILTER_UNSAFE_RAW

2. FILTER_FLAG_NONE Allows no ags

Only for inputs that starts with a zero


3. FILTER_FLAG_ALLOW_OCTAL (0) as octal numbers. This only allows
the succeeding digits to be 0-7

/
Only for inputs that starts with 0x/0X
as hexadecimal numbers. This only
4. FILTER_FLAG_ALLOW_HEX
allows succeeding characters to be
a-fA-F0-9

Strip characters with ASCII value


5. FILTER_FLAG_STRIP_LOW
lower than 32

Strip characters with ASCII value


6. FILTER_FLAG_STRIP_HIGH
greater than 127

Encode characters with ASCII value


7. FILTER_FLAG_ENCODE_LOW
lower than 32

Encode characters with ASCII value


8. FILTER_FLAG_ENCODE_HIGH
greater than 127

9. FILTER_FLAG_ENCODE_AMP Encode &

10. FILTER_FLAG_NO_ENCODE_QUOTES Do not encode ' and "

11. FILTER_FLAG_EMPTY_STRING_NULL Not in use

Allows a period (.) as a fractional


12. FILTER_FLAG_ALLOW_FRACTION
separator in numbers

Allows a comma (,) as a thousands


13. FILTER_FLAG_ALLOW_THOUSAND
separator in numbers

Allows an e or E for scienti c notation


14. FILTER_FLAG_ALLOW_SCIENTIFIC
in numbers

15. FILTER_FLAG_PATH_REQUIRED The URL must contain a path part

/
16. FILTER_FLAG_QUERY_REQUIRED The URL must contain a query string

Allows the IP address to be in IPv4


17. FILTER_FLAG_IPV4
format

Allows the IP address to be in IPv6


18. FILTER_FLAG_IPV6
format

Fails validation for the reserved IPv4


ranges: 0.0.0.0/8, 169.254.0.0/16,
19. FILTER_FLAG_NO_RES_RANGE 127.0.0.0/8 and 240.0.0.0/4, and for
the reserved IPv6 ranges: ::1/128,
::/128, :: :0:0/96 and fe80::/10

Fails validation for the private IPv4


ranges: 10.0.0.0/8, 172.16.0.0/12 and
20. FILTER_FLAG_NO_PRIV_RANGE
192.168.0.0/16, and for the IPv6
addresses starting with FD or FC

Allows the local part of the email


21. FILTER_FLAG_EMAIL_UNICODE address to contain Unicode
characters

22. FILTER_REQUIRE_SCALAR The value must be a scalar

23. FILTER_REQUIRE_ARRAY The value must be an array

Treats a scalar value as an array with


24. FILTER_FORCE_ARRAY
the scalar value as only element

Return NULL on failure for


25. FILTER_NULL_ON_FAILURE
unrecognized boolean values

/
26. FILTER_VALIDATE_BOOLEAN Validates a boolean

Validates value as a valid email


27. FILTER_VALIDATE_EMAIL
address

28. FILTER_VALIDATE_FLOAT Validates value as oat

29. FILTER_VALIDATE_INT Validates value as integer

30. FILTER_VALIDATE_IP Validates value as IP address

31. FILTER_VALIDATE_MAC Validates value as MAC address

Validates value against a regular


32. FILTER_VALIDATE_REGEXP
expression

33. FILTER_VALIDATE_URL Validates value as URL

Removes all illegal characters from


34. FILTER_SANITIZE_EMAIL
an email address

35. FILTER_SANITIZE_ENCODED Removes/Encodes special characters

36. FILTER_SANITIZE_MAGIC_QUOTES Apply addslashes()

Remove all characters, except digits,


37. FILTER_SANITIZE_NUMBER_FLOAT
+- signs, and optionally .,eE

Removes all characters except digits


38. FILTER_SANITIZE_NUMBER_INT
and + - signs

39. FILTER_SANITIZE_SPECIAL_CHARS Removes special characters

Removes tags/special characters


40. FILTER_SANITIZE_STRING
from a string
/
41. FILTER_SANITIZE_STRIPPED Alias of FILTER_SANITIZE_STRING

Removes all illegal characters from s


42. FILTER_SANITIZE_URL
URL

Do nothing, optionally strip/encode


43. FILTER_UNSAFE_RAW
special characters

Call a user-de ned function to lter


44. FILTER_CALLBACK
data

45. INPUT_POST POST variables

46. INPUT_GET GET variables

47. INPUT_COOKIE COOKIE variables

48. INPUT_ENV ENV variables

49. INPUT_SERVER SERVER variables

Mail Functions
The Mail function allows sending mail directly from script.

1. ezmlm_hash() Calculates the hash value by the EZMLM mailing list system.

2. mail() Allows you to send emails directly from a script.

FTP Functions
The FTP Functions give the client access to the le servers through the File Transfer Protocol(FTP). The
FTP functions are used to open, login and close connections, upload, download, rename, delete and get
information on les from le servers.

1. ftp_alloc() Allocates space for a le to be uploaded to the FTP server.

Changes the current directory to the parent directory on the


2. ftp_cdup()
FTP server.

/
3. ftp_chdir() Changes the current directory on the FTP server

4. ftp_chmod() Sets the permissions on a le via FTP

5. ftp_close() Closes an FTP connection.

6. ftp_connect() Opens an FTP connection

7. ftp_delete() Deletes a le on the FTP server.

8. ftp_exec() Executes a program/command on the FTP server.

Downloads a le from the FTP server and saves it to an open


9. ftp_fget()
le.

Uploads from an open le and saves it to a le on the FTP


10. ftp_fput()
server.

11. ftp_get_option() Returns runtime behaviours of the FTP connection.

12. ftp_get() Downloads a le from the FTP server.

13. ftp_login() Logs on to an FTP connection

14. ftp_mdtm() Returns the last modi ed time of a speci ed le.

15. ftp_mkdir() Creates a new directory on the FTP server.

16. ftp_nb_continue() Continues retrieving/sending a le (non-blocking)

Downloads a le from the FTP server and saves it to an open


17. ftp_nb_fget()
le (non-blocking)

Uploads from an open le and saves it to a le on the FTP


18. ftp_nb_fput()
server (non-blocking)

19. ftp_nb_get() Downloads a le from the FTP server (non-blocking)

20. ftp_nb_put() Uploads a le to the FTP server (non-blocking)

21. ftp_nlist() Lists the les in a speci ed directory on the FTP server.

/
22. ftp_pasv() Turns passive mode on or o .

23. ftp_put() Uploads a le to the FTP server.

24. ftp_pwd() Returns the current directory name.

25. ftp_quit() Alias of ftp_close()

26. ftp_raw() Sends a raw command to the FTP server

27. ftp_rawlist() Returns a detailed list of les in the speci ed directory

28. ftp_rename() Renames a le or a directory on the FTP server.

29. ftp_rmdir() Removes a directory on the FTP server.

30. ftp_set_option() Sets runtime options for the FTP connection

31. ftp_site() Sends a SITE command to the server.

32. ftp_size() Returns the size of the speci ed le.

33. ftp_ssl_connect() Opens a secure SSL-FTP connection

34. ftp_systype() Returns the system type identi er of the FTP server.

FTP Constants
1 FTP_ASCII |
It is the FTP transfer mode.
. FTP_TEXT

2 FTP_BINARY |
It is the FTP transfer mode.
. FTP_IMAGE

3 FTP_TIMEOUT_
Timeout used for network operations
. SEC

4 FTP_AUTOSEE
Sets miscellaneous runtime FTP options.
. K

/
5 FTP_AUTORES Automatically determine the resume position and start position for GET and PUT
. UME requests. FTP_AUTOSEEK needs to be enabled.

6
FTP_FAILED Asynchronous transfer has failed.
.

7
FTP_FINISHED Asynchronous transfer has completed.
.

8 FTP_MOREDAT
Asynchronous transfer is in progress.
. A

HTTP Functions
1. header() Sends a raw HTTP header to a client.

2. headers_list() Returns a list of response headers sent(or ready to send)

3. headers_sent() Checks if/where the HTTP headers have been sent.

4. setcookie() Sends an HTTP cookie to a client.

5. setrawcookie() Sends an HTTP cookie without URL encoding the cookie value.

Simple XML Functions


Allow us to easily manipulate and get XML Data. It gets an element’s name, attributes and textual content
once the XML document’s structure or layout is known. Simple XML converts an XML document into a
data structure that can be iterated through like arrays and objects.

1. __construct() Creates a new SimpleXML Element Object

2. addAttribute() Adds an attribute to the SimpleXML element

3. addChild() Adds a child element from the SimpleXML element.

4. asXML() Gets an XML string from a SimpleXML element.

5. attributes() Gets a SimpleXML element’s attributes.

6. children() Gets the children of a speci ed node.

/
7. getDocNamespaces() Gets the namespaces of an XML document.

8. getName() Gets the name of a SimpleXML element.

9. getNamespace() Gets the namespaces from XML data.

10. registerXPathNamespace() Creates a namespaces context for the next XPath query.

11. simplexml_import_dom() Gets a SimpleXMLElement object from a DOM node.

12. simplexml_load_ le() Gets a SimpleXMLElement object from an XML document.

13. simplexml_load_string() Gets a SimpleXMLElement object from an XML string.

14. xpath() Runs an XPath query on XML data.

LIBXML Functions
These functions are used with SimpleXML, XSLT and DOM Functions.

1. libxml_clear_errors() Clear libxml error bu er

2
libxml_get_errors() Retrieve array of errors
.

3
libxml_get_last_error() Retrieve last error from libxml
.

4 libxml_set_streams_contex
Set the streams context for the next libxml document load or write.
. t()

5 libxml_use_internal_errors( Disable libxml errors and allow user to fetch error information as
. ) needed.

LIBXML Constants
Make line numbers greater than 65535 to be
1. LIBXML_BIGLINES
reported correctly

Set small nodes allocation optimization. This


2. LIBXML_COMPACT
may improve the application performance

/
3. LIBXML_DOTTED_VERSION Get dotted libxml version (e.g. 2.6.5 or 2.6.17)

4. LIBXML_DTDATTR Set default DTD attributes

5. LIBXML_DTDLOAD Load external subset

6. LIBXML_DTDVALID Validate with the DTD

7. LIBXML_ERR_ERROR Get recoverable errors

8. LIBXML_ERR_FATAL Get fatal errors

9. LIBXML_ERR_NONE Get no errors

10. LIBXML_ERR_WARNING Get simple warnings

Set HTML_PARSE_NOIMPLIED ag. This turns


11. LIBXML_HTML_NOIMPLIED o automatic adding of implied html/body
elements

Set HTML_PARSE_NODEFDTD ag. This


12. LIBXML_HTML_NODEFDTD prevents a default doctype to be added, if no
doctype is found

13. LIBXML_NOBLANKS Remove blank nodes

14. LIBXML_NOCDATA Set CDATA as text nodes

Change empty tags (e.g. <br/> to <br></br>),


15. LIBXML_NOEMPTYTAG only available in the DOMDocument->save()
and DOMDocument->saveXML() functions

16. LIBXML_NOENT Substitute entities

17. LIBXML_NOERROR Do not show error reports

18. LIBXML_NONET Stop network access while loading documents

19. LIBXML_NOWARNING Do not show warning reports

/
Drop the XML declaration when saving a
20. LIBXML_NOXMLDECL
document

21. LIBXML_NSCLEAN Remove excess namespace declarations

Set XML_PARSE_HUGE ag. This relaxes any


hardcoded limit from the parser, such as
22. LIBXML_PARSEHUGE
maximum depth of a document or the size of
text nodes

Set XML_PARSE_PEDANTIC ag. This enables


23. LIBXML_PEDANTIC
pedantic error reporting

24. LIBXML_XINCLUDE Use XInclude substitution

25. LIBXML_VERSION Get libxml version (e.g. 20605 or 20617)

Create default or xed value nodes during XSD


26. LIBXML_SCHEMA_CREATE
schema validation

XML Parser Functions


XML is a data format intended for standardized structured document exchange. They help to parse XML
documents. They however do not help to validate the documents. The XML parser functions enables us
to create XML parsers and de ne handlers for XML events.

1. utf8_decode() Decodes an UTF-8 string to ISO-8859-1

2. utf8_encode() Encodes an ISO-8859-1 string to UTF-8

3. xml_error_string() Gets an error string from the XML parser.

4. xml_get_current_byte_index() Gets the current byte index from the XML parser.

5. xml_get_current_column_number() Gets the current column number from the XML parser.

6. xml_get_current_line_number() Gets the current line number from the XML parser

7. xml_get_error_code() Gets an error code from the XML parser.

8. xml_parse() Parses an XML document.

/
9. xml_parse_into_struct() Parse XML data into an array.

10. xml_parser_create_ns() Create an XML parser with namespace support.

11. xml_parser_create() Create an XML parser

12. xml_parser_free() Free an XML parser

13. xml_parser_get_option() Get options from an XML parser

14. xml_parser_set_option() Set options in an XML parser

15. xml_set_character_data_handler() Set handler function for character data.

16. xml_set_default_handler() Set default handler function.

Set handler function for start and end of element of


17. xml_set_element_handler()
elements.

xml_set_end_namespace_decl_handl Set handler function for the end of namespace


18.
er() declarations

19. xml_set_external_entity_ref_handler() Set handler functions for external entities.

20
xml_set_notation_decl_handler() Set handler function for notation declarations.
.

21. xml_set_object() Use XML Parser within an object.

22 xml_set_processing_instruction_hand
Set handler function for processing instruction.
. ler()

23 xml_set_start_namespace_decl_hand Set handler function for the start of namespace


. ler() declarations

24 xml_set_unparsed_entity_decl_handl
Set handler function for unparsed entity declarations.
. er()

XML Parser Constants


1. XML_ERROR_NONE (integer) 2. XML_ERROR_ASYNC_ENTITY (integer)

/
3. XML_ERROR_NO_MEMORY (integer) 4. XML_ERROR_BAD_CHAR_REF (integer)

5. XML_ERROR_SYNTAX (integer) 6. XML_ERROR_BINARY_ENTITY_REF (integer)

XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_
7. XML_ERROR_NO_ELEMENTS (integer) 8.
REF (integer)

10
9. XML_ERROR_INVALID_TOKEN (integer) XML_ERROR_MISPLACED_XML_PI (integer)
.

XML_ERROR_UNCLOSED_TOKEN 12
11. XML_ERROR_UNKNOWN_ENCODING (integer)
(integer) .

13 14
XML_ERROR_PARTIAL_CHAR (integer) XML_ERROR_INCORRECT_ENCODING (integer)
. .

15 16 XML_ERROR_UNCLOSED_CDATA_SECTION
XML_ERROR_TAG_MISMATCH (integer)
. . (integer)

17 XML_ERROR_DUPLICATE_ATTRIBUTE 18 XML_ERROR_EXTERNAL_ENTITY_HANDLING
. (integer) . (integer)

19 XML_ERROR_JUNK_AFTER_DOC_ELEME 2
XML_OPTION_CASE_FOLDING (integer)
. NT (integer) 0.

21 XML_ERROR_PARAM_ENTITY_REF 2
XML_OPTION_TARGET_ENCODING (integer)
. (integer) 2.

2 XML_ERROR_UNDEFINED_ENTITY 2
XML_OPTION_SKIP_TAGSTART (integer)
3. (integer) 4.

2 XML_ERROR_RECURSIVE_ENTITY_REF 2
XML_OPTION_SKIP_WHITE (integer)
5. (integer) 6.

MYSQLI Functions
These functions allow you to access MySQL database servers.

Gets the number of a ected rows in the


1. mysqli::$a ected_rows
previous MySQL operation

/
Turns on or o auto committing
2. mysqli::autocommit()
database modi cations

Changes the user of the speci ed


3. mysqli::change_user()
database connection.

Returns the default character set for the


4. mysqli::character_set_name()
database connection

5. mysqli::$client_info Get MySQL client info

Returns the MySQL client version as a


6. mysqli::$client_version
string.

Closes a previously opened database


7. mysqli::close()
connection.

8. mysqli::commit() Commits the current transaction.

Returns the error code from the last


9. mysqli::$connect_errno
connect call.

Returns a string description of the last


10. mysqli::$connect_error
connect error.

Open a new connection to the MySQL


11. mysqli::__construct()
server.

12. mysqli::debug() Performs debugging operations.

Dump debugging information into the


13. mysqli::dump_debug_info()
log.

Returns the error code for the most


14. mysqli::$errno
recent function call.

Returns a list of errors from the last


15. mysqli::$error_list
command executed.

Returns a string description of the last


16. mysqli::$error
error.

/
Returns the number of columns for the
17. mysqli::$ eld_count
most recent query.

18. mysqli::get_charset() Returns a character set object.

19. mysqli::get_client_info() Get MySQL client info.

20. mysqli_get_client_stats() Returns client per-process statistics

Returns the MySQL client version as a


21. mysqli_get_client_version()
string.

Returns statistics about the client


22. mysqli::get_connection_stats()
connection

Returns a string representing the type of


23. mysqli::$host_info
connection used.

Returns the version of the MySQL


24. mysqli::$protocol_version
protocol used.

Returns the version of the MySQL


25. mysqli::$server_info
Server.

Returns the version of the MySQL server


26. mysqli::$server_version
as an integer.

27. mysqli::get_warnings() Get the result of “SHOW WARNINGS”.

Retrieves information about the most


28. mysqli::$info
recently executed query.

Initializes MYSQLi and returns a


29. mysqli::init() resource for use with mysqli_real
connect()

Returns the auto generated id used in


30. mysqli::$insert_id
the last query.

31. mysqli::kill() Asks the server to kill a MySQL thread.

/
Check if there are any more query
32. mysqli::more_results()
results from a multi query.

33. mysqli::multi_query() Performs a query on a database.

34. mysqli::next_result() Prepare next result from a multi_query.

35. mysqli::options() Set options.

Pings a server connection, or tries to


36. mysqli::ping() reconnect if the condition has gone
down.

37. mysqli::poll() Poll connections.

38. mysqli::prepare() Prepare a SQL statement for execution.

39. mysqli::query() Performs a query on the database.

40. mysqli::real_connect() Opens a connection to a mysql server.

Escapes special characters in a string for


use in a SQL statement, taking into
41. mysqli::real_escape_string()
account the current charset of the
connection.

42. mysqli::real_query() Execute a SQL query.

43. mysqli::reap_async_query() Get the result from async query.

44. mysqli::refresh() Refreshes

45. mysqli::rollback() Rolls back current transaction.

46. mysqli::rpl_query_type() Returns RPL query type.

Selects the default database for


47. mysqli::select_db()
database queries.

48. mysqli::send_query() Send the query and return.

/
49. mysqli::set_charset() Sets the default client character set.

Unsets user de ned handler for load


50. mysqli::set_local_in le_default()
local in le command.

Se callback function for LOAD DATA


51. mysqli::set_local_in le_handler()
LOCAL INFILE command.

Returns the SQLSTATE error from


52. mysqli::$sqlstate
previous MySQL operation.

Used for establishing secure


53. mysqli::ssl_set()
connections using SSL

54. mysqli::stat() Gets the current system status.

Initializes a statement and returns an


55. mysqli::stmt_init()
object for use with mysqli_stmt prepare.

56. mysqli::store_result() Transfers a result set from the last query.

Returns the thread ID for the current


57. mysqli::$thread_id
connection.

Returns whether thread safety is given


58. mysqli::thread_safe()
or not.

59. mysqli::use_result() Initiate a result set retrieval.

Returns the number of warnings from


60. mysqli::$warning_count
the last query for the given link.

MYSQLI Statements Constants


mysqli_stmt::$a ected Returns the total number of rows changed, deleted, or inserted by the
1.
_rows last executed statement.

2. mysqli_stmt::attr_get() Used to get the current value of a statement attribute.

3. mysqli_stmt::attr_set() Used to modify the behaviour of a prepared statement.

/
mysqli_stmt::bind_para
4. Binds variables to a prepared statement as parameters.
m()

mysqli_stmt::bind_resu
5. Binds variables to a prepared statement for result storage.
lt()

6. mysqli_stmt::close() Closes a prepared statement.

mysqli_stmt::data_see
7. Seeks to an arbitrary row in statement result set.
k()

8. mysqli_stmt::$errno Returns the error code for the most recent statement call.

mysqli_stmt::$error_lis
9. Returns a list of errors from the last statement executed.
t

1
mysqli_stmt::$error Returns a string description for last statement error.
0.

11
mysqli_stmt::execute() Executes a prepared query.
.

1
mysqli_stmt::fetch() Fetch results from a prepared statement into the bound variables.
2.

1 mysqli_stmt::$ eld_co
Returns the number of elds in the given statement.
3. unt

1 mysqli_stmt::free_resul
Frees stored result memory for the given statement handle.
4. t()

1 mysqli_stmt::get_result
Gets a result from a prepared statement.
5. ()

1 mysqli_stmt::get_warni
Get result of SHOW WARNINGS
6. ngs()

17
mysqli_stmt::$insert_id Get the ID generated from the previous insert operation.
.

1 mysqli_stmt::more_res
Check if there are any more query results from a multiple query.
8. ults()
/
1 mysqli_stmt::next_resu
Reads the next result from a multiple query.
9. lt()

2 mysqli_stmt::$num_ro
Return the number of rows in statements result set.
0. ws

2 mysqli_stmt::$param_c
Returns the number of parameters for the given statement.
1. ount

2
mysqli_stmt::prepare() Prepares an SQL statement for execution.
2.

2
mysqli_stmt::reset() Resets a prepared statement.
3.

2 mysqli_stmt::result_me
Returns result set metadata from a prepared statement.
4. tadata()

2 mysqli_stmt::send_lon
Send data in blocks.
5. g_data()

2
mysqli_stmt::$sqlstate Returns SQLSTATE error from previous statement operation.
6.

2 mysqli_stmt::store_res
Transfers a result set from a prepared statement.
7. ult()

MYSQLI Result Class


Get current eld o set of a result
1. mysqli_result::$current_ eld
pointer.

Adjusts the result pointer to an


2. mysqli_result::data_seek()
arbitrary row in the result.

Fetches all result rows as an


3. mysqli_result::fetch_all() associative array, a numeric array, or
both.

Fetch a result row as an associative, a


4. mysqli_result::fetch_array()
numeric array, or both.

/
Fetch a result row as an associative
5. mysqli_result::fetch_assoc()
array.

6. mysqli_result::fetch_ eld_direct() Fetch meta-data for a single eld.

7. mysqli_result::fetch_ eld() Returns the next eld in the result set.

Returns an array of objects


8. mysqli_result::fetch_ elds()
representing the elds in a result set.

Returns the current row of a result se


9. mysqli_result::fetch_object()
as an object.

Get a result row as an enumerated


10. mysqli_result::fetch_row()
array.

11. mysqli_result::$ eld_count Get the number of elds in a result.

Set result pointer to a speci ed eld


12. mysqli_result:: eld_seek()
o set.

Frees the memory associated with a


13. mysqli_result::free()
result.

Returns the length of the column of the


14. mysqli_result::$lengths
current row in the result set.

15. mysqli_result::$num_rows Gets the number of rows in a result.

MYSQLI Driver Class


1. mysqli_driver::embedded_server_end() Stop embedded server

2. mysqli_driver::embedded_server_start() Initialize and start embedded server

Enables or disables internal report


3. mysqli_driver::$report_mode
functions

4. mysqli_driver::$client_info The Clients API header version.

5. mysqli_driver::$client_version The Client Version

/
6. mysqli_driver::$driver_version The MySQLi Driver Version

Whether MySQLi Embedded


7. mysqli_driver::$embedded
support is enabled.

8. mysqli_driver::$reconnect Allow or prevent reconnect

Set to MYSQLi_REPORT_OFF,
MYSQLi_REPORT_ALL or any
combination of
MYSQLI_REPORT_STRICT (throw
9. mysqli_driver::$report_mode Exceptions for errors),
MYSQLI_REPORT_ERROR (report
errors) and
MYSQLI_REPORT_INDEX (errors
regarding indexes).

MYSQLI Warning Class


1. mysqli_warning::__construct() The _construct purpose

2. mysqli_warning::next() The next purpose

3. mysqli_warning::$message Message string

4. mysqli_warning::$sqlstate SQL State

5. mysqli_warning::$errno The MySQLi Driver Version

MYSQLi Constants
Read options from the named
group from my.cnf or the le
1. MYSQLI_READ_DEFAULT_GROUP
speci ed with
MYSQLI_READ_DEFAULT_FILE

Read options from the named


2. MYSQLI_READ_DEFAULT_FILE
option le instead of from my.cnf

3. MYSQLI_OPT_CONNECT_TIMEOUT Connect timeout in seconds

/
Enables command LOAD LOCAL
4. MYSQLI_OPT_LOCAL_INFILE
INFILE

Command to execute when


connecting to MySQL server. Will
5. MYSQLI_INIT_COMMAND
automatically be re-executed
when reconnecting.

Use SSL (encrypted protocol).


This option should not be set by
6. MYSQLI_CLIENT_SSL application programs; it is set
internally in the MySQL client
library

7. MYSQLI_CLIENT_COMPRESS Use compression protocol

Allow interactive_timeout
seconds (instead of wait_timeout
seconds) of inactivity before
closing the connection. The
8. MYSQLI_CLIENT_INTERACTIVE
client's session wait_timeout
variable will be set to the value of
the session interactive_timeout
variable.

Allow spaces after function


9. MYSQLI_CLIENT_IGNORE_SPACE names. Makes all functions names
reserved words.

Don't allow the


10. MYSQLI_CLIENT_NO_SCHEMA db_name.tbl_name.col_name
syntax.

Allows multiple semicolon-


11. MYSQLI_CLIENT_MULTI_QUERIES delimited queries in a single
mysqli_query() call.

12. MYSQLI_STORE_RESULT For using bu ered resultsets

13. MYSQLI_USE_RESULT For using unbu ered result sets

/
Columns are returned into the
14. MYSQLI_ASSOC array having the eldname as the
array index.

Columns are returned into the


15. MYSQLI_NUM array having an enumerated
index.

Columns are returned into the


array having both a numerical
16. MYSQLI_BOTH
index and the eldname as the
associative index.

Indicates that a eld is de ned as


17. MYSQLI_NOT_NULL_FLAG
NOT NULL

18. MYSQLI_PRI_KEY_FLAG Field is part of a primary index

19. MYSQLI_UNIQUE_KEY_FLAG Field is part of a unique index.

20. MYSQLI_MULTIPLE_KEY_FLAG Field is part of an index.

21. MYSQLI_BLOB_FLAG Field is de ned as BLOB

22. MYSQLI_UNSIGNED_FLAG Field is de ned as UNSIGNED

23. MYSQLI_ZEROFILL_FLAG Field is de ned as ZEROFILL

Field is de ned as
24. MYSQLI_AUTO_INCREMENT_FLAG
AUTO_INCREMENT

25. MYSQLI_TIMESTAMP_FLAG Field is de ned as TIMESTAMP

26. MYSQLI_SET_FLAG Field is de ned as SET

27. MYSQLI_NUM_FLAG Field is de ned as NUMERIC

28. MYSQLI_PART_KEY_FLAG Field is part of an multi-index

29. MYSQLI_GROUP_FLAG Field is part of GROUP BY


/
30. MYSQLI_TYPE_DECIMAL Field is de ned as DECIMAL

Precision math DECIMAL or


31. MYSQLI_TYPE_NEWDECIMAL NUMERIC eld (MySQL 5.0.3 and
up)

Field is de ned as BIT (MySQL


32. MYSQLI_TYPE_BIT
5.0.3 and up)

32. MYSQLI_TYPE_TINY Field is de ned as TINYINT

34. MYSQLI_TYPE_SHORT Field is de ned as SMALLINT

35. MYSQLI_TYPE_LONG Field is de ned as INT

36. MYSQLI_TYPE_FLOAT Field is de ned as FLOAT

37. MYSQLI_TYPE_DOUBLE Field is de ned as DOUBLE

38. MYSQLI_TYPE_NULL

39. MYSQLI_TYPE_TIMESTAMP Field is de ned as TIMESTAMP

40. MYSQLI_TYPE_LONGLONG Field is de ned as BIGINT

41. MYSQLI_TYPE_INT24 Field is de ned as MEDIUMINT

42. MYSQLI_TYPE_DATE Field is de ned as DATE

43. MYSQLI_TYPE_TIME Field is de ned as TIME

44. MYSQLI_TYPE_DATETIME Field is de ned as DATETIME

45. MYSQLI_TYPE_YEAR Field is de ned as YEAR

46. MYSQLI_TYPE_NEWDATE Field is de ned as DATE

47. MYSQLI_TYPE_INTERVAL Field is de ned as INTERVAL

/
48. MYSQLI_TYPE_ENUM Field is de ned as ENUM

49. MYSQLI_TYPE_SET Field is de ned as SET

50. MYSQLI_TYPE_TINY_BLOB Field is de ned as TINYBLOB

51. MYSQLI_TYPE_MEDIUM_BLOB Field is de ned as MEDIUMBLOB

52. MYSQLI_TYPE_LONG_BLOB Field is de ned as LONGBLOB

53. MYSQLI_TYPE_BLOB Field is de ned as BLOB

54. MYSQLI_TYPE_VAR_STRING Field is de ned as VARCHAR

Field is de ned as CHAR or


55. MYSQLI_TYPE_STRING
BINARY

Field is de ned as TINYINT. For


56. MYSQLI_TYPE_CHAR CHAR, see
MYSQLI_TYPE_STRING

57. MYSQLI_TYPE_GEOMETRY Field is de ned as GEOMETRY

More data available for bind


58. MYSQLI_NEED_DATA
variable

No more data available for bind


59. MYSQLI_NO_DATA
variable

Data truncation occurred.


60. MYSQLI_DATA_TRUNCATED Available since PHP 5.1.0 and
MySQL 5.0.5.

Field is de ned as ENUM.


61. MYSQLI_ENUM_FLAG
Available since PHP 5.3.0.

Report if no index or bad index


62. MYSQLI_REPORT_INDEX
was used in a query.

/
Report errors from mysqli function
63. MYSQLI_REPORT_ERROR
calls.

Throw a mysqli_sql_exception for


64. MYSQLI_REPORT_STRICT
errors instead of warnings.

65. MYSQLI_REPORT_ALL Set all options on (report all).

66. MYSQLI_REPORT_OFF Turns reporting o .

Is set to 1 if mysqli_debug()
67. MYSQLI_DEBUG_TRACE_ENABLED
functionality is enabled.

68. MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED

69. MYSQLI_SERVER_QUERY_NO_INDEX_USED

70. MYSQLI_REFRESH_GRANT Refreshes the grant tables.

Flushes the logs, like executing


71. MYSQLI_REFRESH_LOG
the FLUSH LOGS SQL statement.

Flushes the table cache, like


72. MYSQLI_REFRESH_TABLES executing the FLUSH TABLES
SQL statement.

Flushes the host cache, like


73. MYSQLI_REFRESH_HOSTS executing the FLUSH HOSTS SQL
statement.

Reset the status variables, like


74. MYSQLI_REFRESH_STATUS executing the FLUSH STATUS
SQL statement.

75. MYSQLI_REFRESH_THREADS Flushes the thread cache.

/
On a slave replication server:
resets the master server
76. MYSQLI_REFRESH_SLAVE information, and restarts the
slave. Like executing the RESET
SLAVE SQL statement.

On a master replication server:


removes the binary log les listed
in the binary log index, and
77. MYSQLI_REFRESH_MASTER
truncates the index le. Like
executing the RESET MASTER
SQL statement.

MISC Functions
All other categorized functions have been placed under this category. The behavior of these functions
are a ected by settings in the php.ini le.

1. connection_aborted() Checks whether the client has disconnected.

2. connection_status() Returns the current connection status

3. connection_timeout() Deprecated since PHP 4.0.5

4. constant() Returns the value of a constant.

5. de ne() De nes a constant.

6. de ned() Checks whether a constant exists.

7. die() Prints a message and exits the current script

8. eval() Evaluates a string as PHP Code

9. exit() Prints a message and exits the current script.

10. get_browser() Returns the capabilities of the user’s browser

11. highlight_ le() Outputs a le with the PHP syntax highlighted

12. highlight_string() Outputs a string with the PHP syntax highlighted.

/
Sets whether a remote client can abort the running of
13. ignore_user_abort()
a script.

14. pack() Packs data into a binary string

Removes the whitespaces and PHP Comments from


15. php_strip_whitespace()
the source code of a le.

16. show_source() Alias of highlight_ le()

17. sleep() Delays code execution for a number of seconds.

Delays code execution for a number of seconds and


18. time_nanosleep()
nanoseconds.

19. time_sleep_until() Delays code execution until a speci ed time.

20. uniqid() Generates a unique ID

21. unpack() Unpacks data from a binary string.

22. usleep() Delays code execution for a number of microseconds.

MISC. Constants
1. CONNECTION_ABORTED Connection is aborted by the user or network error.

2. CONNECTION_NORMAL Connection is running normally.

3. CONNECTION_TIMEOUT Connection timed out.

4. __COMPILER_HALT_OFFSET__ Determines the byte position of the data start.

Object-Oriented Programming
PHP codes can also be written in Object-Oriented Format. OOP is faster and easier to execute. The OOP
structure makes the code easier to maintain, modify and debug.

Classes with a constructor method call this method on each newly


1. __construct() created object, so it is suitable for any initialization that the object
may need before it is used.

/
Called as soon as there are no other references to a particular
2. __destruct()
object, or in any order during the shutdown sequence.

3. __callStatic() Triggered when invoking inaccessible methods in a static context.

4. __call() Triggered when invoking inaccessible methods in an object context.

5. __get() Utilized for reading data from inaccessible properties.

6. __set() Run when writing data to inaccessible properties.

7. __isset() Triggered by calling isset() or empty() on inaccessible properties.

8. __unset() Invoked when unset() is used on inaccessible properties.

The intended use of _sleep() is to commit pending data or perform


9. __sleep() similar cleanup tasks. Also, the function is useful if you have very
large objects which do not need to be saved completely.

Used to re-establish database connections that may have been lost


10. __wakeup()
during serialization and perform other reinitialization tasks.

Allows a class to decide how it will react when it is treated like a


11. __toString()
string.

12. __invoke() Called when a script tries to call an object as a function.

13. __set_state() Called for classes exported by var_export() since PHP 5.1.0

Once the cloning is complete, if a _clone() method is de ned, then


14. __clone() the newly created object’s _clone() method will be called, to allow
any necessary properties that need to be changed.

Error Functions
These functions are used to handle errors and logging. The logging functions allow sending messages
directly to other machines or systems while the error reporting functions allow customizing the level of
error and feedback given. The behavior of the error functions are a ected by the settings in the php.ini

1. debug_backtrace() Generates a backtrace

2. debug_print_backtrace() Prints a backtrace

/
3. error_get_last() Gets the last error occurred

Sends an error to a server error-log, to a le or


4. error_log()
to a remote destination.

5. error_reporting() Speci es which errors are reported.

6. restore_error_handler() Restores the previous error handler

7. restore_exception_handler() Restores the previous exception handler

8. set_error_handler() Sets a user de ned function to handle errors.

Sets a user de ned function to handle


9. set_exception_handler()
exceptions.

10. trigger_error() Creates a user-de ned error message.

11. user_error() Alias of trigger error.

Error Constants
1 Fatal run-time errors. Errors that cannot be recovered from. Execution of the
E_ERROR1
. script is halted

2
E_WARNING2 Non-fatal run-time errors. Execution of the script is not halted
.

2 Compile-time parse errors. Parse errors should only be generated by the


E_PARSE4
. parser

3 Run-time notices. The script found something that might be an error, but
E_NOTICE8
. could also happen when running a script normally

4
E_CORE_ERROR16 Fatal errors at PHP startup. This is like an E_ERROR in the PHP core
.

5 E_CORE_WARNIN
Non-fatal errors at PHP startup. This is like an E_WARNING in the PHP core
. G32

/
6 E_COMPILE_ERRO Fatal compile-time errors. This is like an E_ERROR generated by the Zend
. R64 Scripting Engine

7 E_COMPILE_WAR Non-fatal compile-time errors. This is like an E_WARNING generated by the


. NING128 Zend Scripting Engine

8 E_USER_ERROR25 Fatal user-generated error. This is like an E_ERROR set by the programmer
. 6 using the PHP function trigger_error()

9 E_USER_WARNIN Non-fatal user-generated warning. This is like an E_WARNING set by the


. G512 programmer using the PHP function trigger_error()

1
E_USER_NOTICE10 User-generated notice. This is like an E_NOTICE set by the programmer
0
24 using the PHP function trigger_error()
.

1
Run-time notices. PHP suggest changes to your code to help interoperability
1 E_STRICT2048
and compatibility of the code
.

1
E_RECOVERABLE_ Catchable fatal error. This is like an E_ERROR but can be caught by a user
2
ERROR4096 de ned handle (see also set_error_handler())
.

1
3 E_ALL6143 All errors and warnings, except of level E_STRICT
.

People are also reading:

Best PHP Certi cations (https://hackr.io/blog/best-php-certi cation)


Best PHP Books (https://hackr.io/blog/best-php-books-for-beginners-and-advanced-programmers)
Di erence between Python vs PHP (https://hackr.io/blog/python-vs-php)
Best PHP Frameworks (https://hackr.io/blog/best-php-frameworks)
Best PHP Proejcts (https://hackr.io/blog/php-projects)
Top PHP Interview Questions (https://hackr.io/blog/php-interview-questions)
Top PHP Alternatives (https://hackr.io/blog/top-php-alternatives)
PHP vs Javascript (https://hackr.io/blog/php-vs-javascript)
PHP vs Node.Js (https://hackr.io/blog/php-vs-node-js)
HTML vs HTML5: Head to Head Comparison (https://hackr.io/blog/di erence-between-html-html5-
xhtml)

/
PHP Cheat Sheet (https://hackr.io/blog/tag/php-cheat-sheet) PHP (https://hackr.io/blog/tag/php)

Cheat Sheet (https://hackr.io/blog/tag/cheat-sheet)

Share:
(https://twitter.com/intent/tweet?text=PHP+Cheat+Sheet+https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fphp-cheat-

sheet) ( https://www.linkedin.com/shareArticle?mini=true&url=https://hackr.io/blog/php-cheat-sheet)

(http://www.reddit.com/submit?url=https://hackr.io/blog/php-cheat-sheet)

(https://news.ycombinator.com/submitlink?u=https://hackr.io/blog/php-cheat-sheet)
(https://api.whatsapp.com/send?text=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fhackr.io%2Fblog%2Fphp-cheat-sheet)

Barnali Chanda
(https://hackr.io/blog/author/barnali.sen)
Barnali is a software developer, who eventually transformed into a technical documentation writer with her
continuous research and development skills. She is an expert in C, C++, PHP, Python and RDBMS. She
makes sure to evolve with technology. Thus, trained in BI, she is a Data Science enthusiast and is on the
verge to pursue a career in Data Science. View all posts by the Author
(https://hackr.io/blog/author/barnali.sen)

Related Posts

(https://hackr.io/blog/php-projects)

Download 10 Best Free PHP Projects with Source Code

(https://hackr.io/blog/php-projects) Read More (https://hackr.io/blog/php-projects)

(https://hackr.io/blog/best-php-certi cation)
/
5 Best PHP Certi cations you need to learn in 2020

(https://hackr.io/blog/best-php-certi cation) Read More (https://hackr.io/blog/best-php-certi cation)

(https://hackr.io/blog/jquery-cheat-sheet-part-2)

JQuery Cheat Sheet [Part 2]

(https://hackr.io/blog/jquery-cheat-sheet-part-2) Read More (https://hackr.io/blog/jquery-cheat-sheet-part-2)

Leave a comment
Email address*

Enter email

Your email will not be published

Name*

Name

Comment*

SUBMIT

Related Tutorials
Java

(https://hackr.io/tutorials/learn-java)
/
Node.js

(https://hackr.io/tutorials/learn-node-js)

Perl

(https://hackr.io/tutorials/learn-perl)

PHP

(https://hackr.io/tutorials/learn-php)

Python

(https://hackr.io/tutorials/learn-python)

Recommended Learning
PHP The Right Way (www.phptherightway.com)

(https://hackr.io/tutorial/php-the-right-way)

PHP for Beginners (www.udemy.com)

(https://hackr.io/tutorial/php-for-beginners)

PHP Front To Back (www.youtube.com)

(https://hackr.io/tutorial/php-front-to-back)

VIEW MORE (https://hackr.io/tutorials/learn-php)

Blog (https://hackr.io/blog) Roadmaps (https://hackr.io/roadmaps) About Us (https://hackr.io/about)

Programming Tips (https://chrome.google.com/webstore/detail/programming-tips/ooaiehbfngcjjeaiedpffeajkeleikpl)

Help & FAQ (https://hackr.io/help) We Feedback

(https://play.google.com/store/apps/details?id=io.hackr.hackr&hl=en)

(https://apps.apple.com/in/app/hackr-io/id1188958684)

Disclosure: This page may contain affliate links, meaning when you click the links and make a purchase, we receive a commission.

You might also like