Random Number: converting JavaScript to PHP
<p>I have the following line of code in javascript:</p>

<pre><code>(Math.random() + "") * 1000000000000000000
</code></pre>

<p>which generates numbers like:</p>

<pre><code>350303159372528000
</code></pre>

<p>I tried the same thing in PHP with this:</p>

<pre><code>rand()*1000000000000000000
</code></pre>

<p>Which returns:</p>

<pre><code>2.272e+21
</code></pre>

<p>I need to use PHP as the number generated will be stored as a SESSION variable and will be used by JavaScript later on. </p>

<p><strong>How do I get PHP to force the number to be an int rather than a float?</strong></p>

<hr>

<p>EDIT PHP seems to struggle with this.</p>

<p>Would it work if I just generated the rand number in PHP saved it to the SESSION and then done the multiplying by 1000000000000000000 in JavaScript?</p>

<p>How would I go about this?</p>
