If you want to build a multilingual website your best option is to use some gettext implementation. PHP has this and most frameworks like CakePHP support this (the keyword to search for is i18n (short for internationalization).
All strings in your app need to be send through the gettext function. In PHP this function is aliased to __()
so that your string will look like this:
<?php
echo __('Hello world');
?>
You then need to generate so called .po files which store these strings together with their translations. An example entry of a .po file looks like this
msgid "Hello world"
msgstr "Ola mundo"
Your app then needs to load the right .po file for the right language. CakePHP has a nice manual for doing this, but other frameworks have this built in as well.