Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Is there any possible way to make this simple script function properly?
<?php $hi = "echo hi"; shell_exec($hi); echo "<pre>$output</pre>"; ?>
please help me out?
shell_exec($hi);
$output = shell_exec($hi);
Sure just assign the variable.
<?php $hi = "echo hi"; $output = shell_exec($hi); echo "<pre>$output</pre>"; ?>
Add a comment
$hi = "echo hi"; # the result needs to be assigned to $output before using it $output = shell_exec($hi); echo "<pre>$output</pre>";
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
shell_exec($hi);read$output = shell_exec($hi);?