PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
ftok - Convert a pathname and a project identifier to a System V IPC key

ftok( string$filename, string$project_id ): int

The function converts the filename of an existing accessible file and a project identifier into an integer for use with for example shmop_open and other System V IPC keys.



Path to an accessible file.


Project identifier. This must be a one character string.

Return Values

On success the return value will be the created key value, otherwise -1 is returned.

Related Functions

Function ftok:

  • Manual

Semaphore, Shared Memory and IPC Functions

Most used PHP functions