Update Registration.php

Rewrite by taking advantage of PHP filter functions