PHP Manual

Data Output

Output a String Output a String

Conditional Statements

Conditional Operator Alternative Condition Additional Condition Multiple Choice Choice Option Default Option Matching

Loops

Conditional Loop Post-condition Loop Counter Loop Array Loop Loop Interruption Loop Continuation

Working with Variables

Existence Check Emptiness Check Variable Deletion Array Creation

Termination

Termination with Output Termination
determining variable type changing variable type integer check floating point number check numeric value check string check boolean value check array check object check NULL value check resource check callable value check iterable value check countable value check conversion to integer conversion to float conversion to string conversion to boolean conversion to array

Mathematical Functions

absolute value exponentiation square root maximum value minimum value rounding numbers round up round down floating-point remainder random number

String Measurement

string length string length string width

Manipulations

trim edges trim beginning trim end string padding string repetition string reverse character shuffling

Case

lowercase uppercase lowercase uppercase first character to uppercase first character to lowercase first character of word to uppercase

Splitting

split string into array split string into array split string into parts split string into variables split string into tokens parse string by format split multibyte string split string into characters get part of string trim string by width

String Parts

get substring get substring

Search and Replace

search and replace case-insensitive replacement search and replace replace part of string

String Search

check if character occurs in string check first occurrence check last occurrence position of first substring occurrence position of last character occurrence case-insensitive search reverse case-insensitive search find first substring occurrence search for any given character in string find first character occurrence find last character occurrence case-insensitive search case-insensitive substring search substring position search last occurrence case-insensitive last occurrence search reverse case-insensitive search reverse substring search first occurrence search

String Counting

count substring occurrences count occurrences count characters count words

Tags and Escaping

remove tags from string output tags to browser reverse operation to htmlspecialchars convert characters to HTML entities reverse operation to htmlentities escape quotes in string remove addslashes escaping escape metacharacters replace invalid characters

String Formatting

number formatting monetary values formatting output formatted string output formatted string string formatting (with return) format string from array insert line break insert line break

Character Codes

character by code character code

String Comparison

Levenshtein distance between strings percentage of string similarity phonetic string comparison improved soundex compare first characters of strings case-insensitive first characters comparison case-sensitive string comparison locale-based string comparison natural string comparison case-insensitive natural comparison case-insensitive string comparison

Arrays

number of elements array with range sum of array elements product of elements array slicing merging arrays merging arrays recursively keys to values selecting array keys selecting array values merging arrays array search count calculation replacement in array array reversal removing duplicates random key array shuffling presence check presence check array to variables array to variables merging array into string into multidimensional array first array element last array element adding to beginning adding to end array padding array filling array filling

Sorting

by element ascending by element descending by key ascending by key descending by element ascending with keys preserved by element descending with keys preserved in natural order in natural order case-insensitive by callback by callback by keys by callback with keys preserved sorting multiple arrays

Callbacks

array modification array traversal multidimensional array traversal array filtering array reduction

Array Intersection

array intersection array intersection with keys intersection by keys intersection with callback comparison intersection with callback comparison intersection with callback keys key intersection with callback

Array Difference

array difference array difference with keys array difference with difference by keys difference with callback comparison difference with callback keys key difference with callback

Main Functions

Pattern Match Match All Patterns Pattern Replacement Filter with Replacement

Additional Functions

String Splitting Replacement with Callback Function Multiple Replacement Array Filtering Character Escaping

Error Handling

Get Error Code Get Error Message

Functional Style

current moment as timestamp specified moment as timestamp date formatting date to timestamp conversion getting microseconds date validity check date object creation date addition and subtraction adding to date subtracting from date interval creation date formatting difference between two dates timezone setting timezone getting

OOP Style

date object immutable date-time date intervals time zones date periods adding to date subtracting from date

DateTime Methods

Create from Format Convert Immutable Format Date Date Difference Modify Date Add Interval Subtract Interval Set Date Set ISO Date Set Time Set Timestamp Set Timezone Get Timezone Get Offset Get Timestamp Parsing Errors

DateInterval Methods

Create from String Format Interval

Basic

getting file contents writing a string to a file file to array

File Operations

deleting a file copying a file renaming a file or folder creating a temporary file creating a file with a unique name

Folder Operations

creating a folder deleting a folder checking if it's a folder reading contents reading contents by pattern available space total folder volume

Checks

checking for file or folder existence checking if it's a file determining file readability checking file writability checking if it's an executable file

File Paths

folder name from path file name from path absolute file path file path information

Information

getting file size changing file permissions changing file owner changing file group setting modification time file modification time file creation time file access time determining MIME type file MIME type clearing stat cache

File Inclusion

File Inclusion Single Inclusion Mandatory Inclusion Single Mandatory Inclusion

Low-level Files

opening a file or URL reading a file reading a line from a file reading a character from a file writing to a file closing a file handle reading a file checking for end of file moving through a file resetting file pointer truncating a file position in file outputting remaining file data

Low-level Folders

reading contents opening a folder closing a folder

Special Files

reading CSV file writing CSV file reading INI file

File Upload

determining file upload moving uploaded file to new location

Miscellaneous

file locking formatted output to stream formatted array output to stream

Existence Checks

Checking Class Existence Checking Method Existence Checking Property Existence Checking Trait Existence Checking Interface Existence

Getting Class Information

Getting Class Name Getting Parent Class Getting Class Methods Getting Class Properties Getting Object Properties Getting Called Class

Type and Relationship Checks

Checking Object Type Checking Class Membership Checking Class Inheritance List of Class Interfaces List of Parent Classes List of Used Traits

Class Autoloading

Defining Namespace Registering Autoloader Getting Autoloaders Removing Autoloader Calling Autoloader

Working with Declarations

Creating Class Alias Getting Declared Classes Getting Declared Interfaces Getting Declared Traits

Creation

Creating Object Declaring Class Declaring Interface Declaring Trait

Calls

Static Call Static Call with Array

Main Magic Methods

Object Constructor Object Destructor Object Cloning

Property Access

Reading Properties Writing Properties Property Check Property Removal

Call Interception

Method Call Static Call Call as Function

Serialization

Preparation for Serialization Object Restoration Modern Serialization Modern Deserialization

Object Conversion

To String For var_export For var_dump

Exception Handling

Handling Block Catching Exceptions Final Actions Exception Throwing Base Exception Class Handling Errors as Exceptions

Functions

error reporting configuration error log writing call tracing trace printing shutdown registration Xdebug call stack user error generation trigger_error analog exception handler setting error handler setting error handler restoration exception handler restoration

Function Checking

checking function existence checking callability

Function Calls

calling a callback function calling with an array of arguments

Working with Arguments

getting arguments counting arguments getting a specific argument

Event Handling

registering a tick function unregistering a tick function

Variables

output information about a variable convenient output of variables

Lists

list of all variables list of all constants list of all functions list of included files

Memory

current memory usage peak memory usage
JSON decoding JSON encoding data serialization data unserialization variable export

Settings

setting configuration value getting configuration value getting all configurations configuration information

Extensions

list of loaded extensions checking extension loading extension functions

Information

language version version comparison
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline