How decode base64 without effecting other code

i have a file which is very lengthy and which contains on different coding also there base64 encoding also using on many place i want to i just put all code in some where and that just decode only base64 code not disturb all other php code which is in file
mean decode only related encoded code
is there any function or any special site which do this ?