Scramble a PHP string
<p>I want to create Unique ID for my site users in this format</p>

<blockquote>
  <p>pubID-john_34032</p>
</blockquote>

<p>So I want to do this using the email string.</p>

<p>I have this pseudo code (but I want it faster and more logical if that makes sense)</p>

<p>How do I write my Pseudo code as PHP?</p>

<pre><code>&lt;?php
$var e(mysqlescape(get(emailform));
$var r(rand(3,34);
$var ex=(pubID-);
$var e=(replace(@/.); //users may enter 1@site.com so replace the at and .
$var e(first4strTo(e)); // get first four letters, example 1sit 
$var e(e)+r(); // e is now 1site-1547
$var printStr e+ex //join the 1site-1547 with pubID- and done
?&gt;
</code></pre>
