Home > Backend Development > PHP Tutorial > PHP如何获得当前的进程id?

PHP如何获得当前的进程id?

PHPz
Release: 2020-06-24 09:54:19
Original
5951 people have browsed it

PHP如何获得当前的进程id?

PHP如何获得当前的进程id?

在PHP中,可以使用posix_getpid()来获得当前的进程id。

posix_getpid

posix_getpid — 返回当前进程 id

说明:

posix_getpid ( void ) : int
Copy after login

Return the process identifier of the current process. 返回当前进程的 id

返回值:

  • 返回进程 id 号,是整型(integer)。

示例:

<?php
echo posix_getpid(); //8805
?>
Copy after login

注:posix_getpid在windows上不起作用。

推荐教程:PHP视频教程

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template