Um, if you really do mean "in PHP", that's covered in the manual.
If you mean in an HTML <a> tag (which is what it sounds like), then the short answer is that you shouldn't. It's an (obvious) massive security hole (and support for it was recently removed from IE) - there's not a lot of point password-protecting pages if you're then going to just give out login names and passwords to all and sundry.
Or, if you're just asking for advice on how to use .htaccess to protect directories without needing authorisation, then I guess the place to look would be Apache's documentation.