public function getRandomId($name)
    {
        if (strpos($name, "[]") !== false) {
            $strReturn = str_replace("[]", "_" . rand(100000, 900000), $name);
        } else {
            $strReturn = $name . "_" . rand(100000, 900000);
        }

        return $strReturn;
    }
public function getRandomId($name)
    {
        if (strpos($name, "[]") !== false) {
            $strReturn = str_replace("[]", "_" . rand(100000, 900000), $name);
        } else {
            $strReturn = $name . "_" . rand(100000, 900000);
        }

        return $strReturn;
    }
public function getRandomId ( $ name ) { if ( strpos ( $ name , "[]" ) !== false ) { $ strReturn = str_replace ( "[]" , "_" . rand ( 100000 , 900000 ) , $ name ) ; } else { $ strReturn = $ name . "_" . rand ( 100000 , 900000 ) ; } return $ strReturn ; }
Generate a random ID for a given field name to prevent having two fields with the same name
@param string $name Field name
@return string
Generate a random ID for a given field name to prevent having two fields with the same name