php preg_replace
<p>i need allowed only letter, numbers, and _.</p>

<p>Anything else replace to space symbol ( _ ).</p>

<p>Whats wrong with my preg patter?
Thanks</p>

<pre><code>&lt;?php
$val = 'dasd Wsd 23 /*~`';
$k = preg_replace('/[a-Z0-9_]+$/', '_', $val);
?&gt;
</code></pre>
