0

I have this:

<?php shell_exec('some_command') ?>;

How can I run 'some_command' more than once?

I'm a code neat freak, calling them more than once kind of an eyesore to me.

3
  • Just do what already works twice. What's the concern? Commented Mar 4, 2014 at 17:48
  • Hey what's with the downvote. I'm a code neat freak, calling them twice kind of an eyesore to me. Commented Mar 4, 2014 at 17:52
  • What are you expecting, a for loop just to do it twice? Commented Mar 4, 2014 at 18:05

1 Answer 1

2

Put the command twice in the argument:

<?php shell_exec('some_command; some_command'); ?>

Or call shell_exec twice:

<?php shell_exec('some_command'); shell_exec('some_command'); ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.