Jump to content

Pass variables to a background process.


mbrown122

Recommended Posts

Assuming your talking about command line script, you would simply pass them as an argument. eg;

 

parent.php

#!/usr/bin/php
<?php

  $arg = 'foo';
  exec("child.php $arg &");

?>

 

child.php

#!/usr/bin/php
<?php

  if ($argc == 1) {
    // do something with $argv[1]; / foo
  }

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.