Add random characters to end of file path
<p>I have this</p>

<pre><code>$resizeObj -&gt; saveImage('images/'.$pic, 90);
</code></pre>

<p>and I want to append random characters at the end of file name in order to prevent duplicate names using somethign like this:</p>

<pre><code>    function genRandomString() {
    $length = 10;
    $characters = ’0123456789abcdefghijklmnopqrstuvwxyz’;
    $string = ”;    

    for ($p = 0; $p &lt; $length; $p++) {
        $string .= $characters[mt_rand(0, strlen($characters))];
    }

    return $string;
}
</code></pre>

<p>Whta is the best way to incorporate this into <code>$resizeObj</code></p>
