You can contact your hosting provider about how to update your php.ini file to remove deprecated messages and I'm sure they can help.
You can add the php anywhere on the page above where the message occurs. The first line of code on the page would work.