Simplify this PHP?
<p>I was copy/pasting some PHP to get the outcome I wanted but I believe this could be simplified in a much better way. Could any developers help a designer out?</p>

<pre><code>&lt;?php
$url = dirname(__FILE__);
$id = substr( $url, strrpos( $url, '/' )+1 );
echo '&lt;img src="../i/';
echo $id;
echo '.png" alt="';
echo $id;
echo '" /&gt;'; 
?&gt;
</code></pre>

<p><strong>Result:</strong>     <code>&lt;img src="(name of $id)" alt="(name of $id)" /&gt;</code></p>
