How can I echo the constant in the right way?

In my header.php I have this.

 <meta name="title" content="<?php echo $meta['title']; ?>" /> 

In my page I have

$meta['title'] = echo ca_text0001_meta; include('header.php'); ?>

in my language file I have

 define("ca_text0001_meta","Some Title text...."); 

This does not work.
How can I echo the constant in the right way?

<?php
define("CA_TEXT0001_META","Some Title text....");
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="title" content="<?php echo CA_TEXT0001_META; ?>" />
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <?= CA_TEXT0001_META  ?>
</body>
</html>

Thanks for the reply.
I would have said that I have several pages with the same header.
I want to use my language file so that I can easily later change the language of all meta tags.
I just want to have only one header.php for all pages.
*There will be different meta tags on all pages.*
Do I have to have several headers or can it be solved in another way,
or is it possible to use my proposal?

I found a solution that works.
In the language file meta_sv.php I have.

[code] $ policy_title = “My Policy Title;” ; [/ code]

[code] $ policy_desc = “My description with swedish letters”; [/ code]

[code] $ policy_keyw = “my, policy”; [/ code]

In the file policy.php I have.

[code] include ("…/lang/meta_sv.php"); [/ code]

[code] $ meta [‘keywords’] = utf8_encode ($ policy_keyw); [/ code]

[code] $ meta [‘description’] = utf8_encode ($ policy_desc); [/ code]

[code] $ meta [‘title’] = utf8_encode ($ policy_title); [/ code]

in the header.php file I have the same as before.

This means that I only need one header.php for each page and can have several different language files.

Sponsor our Newsletter | Privacy Policy | Terms of Service