How can I display information on my site using PHP
?
I am creating a personal website, and I want to make versions of this site in other languages.
What happens is that I need to set the domain of my site to be able to put links.
I was using a include
and in the href=""
links, I would put:
href="<?php include 'dominio.php'; ?>"
And within this domain.php file I only had one text: http://meusite.com
That is, in the end, it was like I was using:
href="http://meusite.com"
Would it be possible to pull more than one information through a particular file?
Something like this:
$dominio['brasil']=http://meusite.com.br;
$dominio['mexico']=http://meusite.com.mx;
$dominio['argentina']=http://meusite.com.ar;
And in each version I used the correct option.
Examples:
In the Brazilian site:
href="<?php $dominio['brasil']; ?>"
that is equal tohref="http://meusite.com.br"
On the Mexican site:
href="<?php $dominio['mexico']; ?>"
that is equal tohref="http://meusite.com.mx"
* I'm not an expert on PHP xD
I do not know what this function is called, I just know it's commonly used to do site translations (which is NOT my case)
It's just kind of like I believe it to be.
I'm not saying that this is how it has to be done and that it's not right, I just imagine it to be something like this:)
In short: A file will have to be created, and within that file it will contain the information, and depending on that information, I'll set the domain inside my site a code that will pull only certain information, in this case the correct domain). In case, each version a different domain, so I need it.