Assuming SHA1 is secure on its own is very very bad practice, let alone an all-around horrible idea, and that goes with any hash function.
First off, SHA1 has already been broken, collisions can be made, there are also rainbow tables out there. Not only this, but I would always suggest making the string to be hashed larger than the resulting digest. Since you know the size of the resulting digest (SHA1 is 140-bit) I'd suggest creating some sort of salt in there, some key to strengthen the resulting digest.
$key = 'jfioepafipo4jeigphaue4gfASE$*(GTA)($GFAUEW$I)GFAHEPGdrjsiv;arshvuialnuiafhuaiewpguzdjlgvd;'; //random 632-bit string because I'm paranoid
$hash = sha1($key.$input);
To compare just use the same key.