After searching through the php base64 comments I found the best way to safely encode and decode base64 url components
If you creating a user signup form with Zend_Form and need a password confirmation field just use the code below, its very simple but couldn't find any info on the zend framework site on how to do it