mbrown122 Posted November 26, 2007 Share Posted November 26, 2007 I know how to start a process in the background, but how do I pass variables (from the calling script) to the background process? Thanks. Quote Link to comment Share on other sites More sharing options...
xyn Posted November 26, 2007 Share Posted November 26, 2007 _get ? Quote Link to comment Share on other sites More sharing options...
trq Posted November 26, 2007 Share Posted November 26, 2007 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 } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.