PHP fork process - getting child output in parent

前端 未结 3 1979
忘掉有多难
忘掉有多难 2021-01-20 03:44

I want to achieve the following:

Initialize an array. Child process adds some elements to the array. Parent process adds some elements to the array. Finally before

3条回答
  •  猫巷女王i
    2021-01-20 04:14

    (sorry for crossposting)

    I suggest a look at socket_create_pair().

    In the PHP manual is a very short & easy example of interprocess communication (IPC) between a fork()-parent and the child.

    And using serialize() und unserialize() You could even transfer complex data types like arrays...

提交回复
热议问题