I have multistep command, that asks for several questions in the process. I need to execute it from within the code.
php command.php
> What is your name?
User Smith
> What is your age?
25
> You are old enough!
But when I call it with exec
it is just stuck.
What I expect, is something like:
<?php
$result = exec('php command.php')->next('User Smith')->next('25');
if ($result->response === 'You are old enough!') echo "Yahoo";
else echo "Oh no!";