getmypid

int getmypid(void) 

Displays the process ID of the current script.

Returns:

Process ID of the executed script; FALSE on error

Description:

This function returns the process ID (PID) of the executed PHP script. This and other related functions may not work correctly in the Win32 version of PHP.

Example:

Display script PID
// this does not work in Windows 
$pid = getmypid(); 
echo $pid; 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.