<?php
/**
* This function generates a password salt as a string of x (default = 15) characters
* in the a-zA-Z0-9!@#$%&*? range.
* @param $max integer The number of characters in the string
* @return string
*
*/
function generateSalt($max = 15) {
$characterList = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*?";
$i = 0;
$salt = "";
while ($i < $max) {
...