removing file names from a list python
<p>I have all filenames of a directory in a list named files. And I want to filter it so only the files with the .php extension remain.</p>

<pre><code>for x in files:
    if x.find(".php") == -1:
        files.remove(x)
</code></pre>

<p>But this seems to skip filenames. What can I do about this?</p>
