Refactor if-else php code
<p>Sorry, noob question. What's the best way to refactor this?</p>

<pre><code>if (is_dir('temp'))
{
  ===== do action A =====
}
else
{
  mkdir("/path/to/my/dir", 0755);
  ===== do action A =====
}
</code></pre>

<p>Thanks.</p>
