PHP Built-in Functions by Category
Browse our comprehensive reference of PHP built-in functions organized by category. Each function page includes detailed documentation, usage examples, parameter descriptions, return values, and common gotchas to help you use PHP functions effectively.
String Functions
Functions for manipulating and processing strings including length, search, replace, and transformation operations.
- strlen() - Get string length
- substr() - Return part of a string
- strpos() - Find position of first occurrence of substring
- str_replace() - Replace all occurrences of search string
- explode() - Split string by delimiter
- implode() - Join array elements with string
- trim() - Strip whitespace from beginning and end
Array Functions
Functions for array manipulation, transformation, filtering, and processing operations.
- array_map() - Apply callback to array elements
- array_filter() - Filter elements using callback
- array_reduce() - Reduce array to single value using callback
- array_merge() - Merge one or more arrays
- in_array() - Check if value exists in array
JSON Functions
Functions for encoding and decoding JSON data in PHP applications.
- json_encode() - Encode value to JSON
- json_decode() - Decode JSON string
Regular Expression Functions
Pattern matching and text processing using Perl-compatible regular expressions.
- preg_match() - Perform regular expression match
How to Use This Reference
Each function reference page includes:
- Function Signature: Complete syntax showing parameters and types
- Description: What the function does and when to use it
- Parameters: Detailed explanation of each parameter
- Return Values: What the function returns and possible return types
- Examples: Practical code examples demonstrating usage
- Notes & Gotchas: Common pitfalls, edge cases, and best practices
Test Functions Online
All function examples can be tested using our online PHP compiler. Click any function to view its documentation and run example code directly in your browser. Modify the examples to experiment with different parameters and see how the function behaves with different inputs.