Little PHP question

Status
Not open for further replies.

Divvy

Active Member
806
2009
18
0
Hello guys,

Maybe you can help me with a little question about PHP...
Im starting to program myself, and Im now making one of my websites multi-language.

Can I use this code inside the <title> tags?
PHP:
<title><?php echo $lang['TITLE']; ?></title>

And this in meta tags?
PHP:
<meta name="description" content="<?php echo $lang['DES']; ?>" />
<meta name="keywords" content="<?php echo $lang['KEY']; ?>" />

Is thos good, bad or equal for SEO?
I just dont want to screw my website position on search engines... :-)

Sorry for the newbie question..

--------------------------------
EDIT
--------------------------------

Btw, Im adding this code in the top of my php files:
PHP:
<?php include("lang/en.php");?>

Im doing this well?
Or is better to use this?
PHP:
<html lang="en-US" ...
Or this is not to use to use multi language?

If yes, what is the code to show the text that I want?

Thanks!
 
4 comments
The way you have is fine. But for the language you need both . The words are located in the appropriate php file and in the html lang you tell the browser what language you are using.
 
as long as it's processed as PHP, yes definitively.
shorthand even: <?=$lang['DES'];?> might work, depending upon configuration you have.
 
Status
Not open for further replies.
Back
Top