There are functions in PHP which you can use to encrypt and decrypt strings, such as MCrypt (
http://uk.php.net/manual/en/book.mcrypt.php). These can be used so you don't have to put the password in the raw source file.
However, if an attacker gets in to your server and can see the encrypted password in the source file, they can just as (or more) easily see the method in which it is encrypted. It wouldnt take them a minute to decrypt it themselves and have access to the database.
It would be better to spend time ensuring access to the server itself is secure.
Hope this helps
Phil