Syntax error, unexpected '=' in /.../.../.../.../variables.php on line 34 [closed]

-1

I do not understand the error, I have reviewed it repeatedly:

<?php
// File used so that shortened pages content can be edited when needed
// This will make instant changes on all the shortened pages content
$title = "mc-pe.us | $servername";
$metainfo = "<meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta name='description' content='Vote for $servername, a Minecraft: PE server registered at $mcpelist.'>
    <meta name='url' content='https://mc-pe.us/$alias'>
    <meta name='author' content=''>";
$favicon = "<link rel='shortcut icon' href='http://www.iconj.com/ico/a/7/a7v4gncdtg.ico'>";
$navbar = "<nav class='navbar navbar-default navbar-fixed-top' role='navigation'>
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class='navbar-header'>
        <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-ex1-collapse'>
            <span class='sr-only'>Toggle navigation</span>
            <span class='icon-bar'></span>
            <span class='icon-bar'></span>
            <span class='icon-bar'></span>
        </button>
        <a class='navbar-brand' href='/'>MCPE Shortener <span class='label label-danger'>BETA</span></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class='collapse navbar-collapse navbar-ex1-collapse'>
            <ul class='nav navbar-nav'>
                <li><a href='/'>Home</a></li>
                <li><a href='/create'>Create</a></li>
                <li><a href='/premium'>Premium</a></li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </nav>";
    $pagetitle = "Outgoing to voting page";
    $pagedescription = "You will leave mc-pe.us to go to the $servername voting page. More detailed server information is available below. You will only be redirected when you touch the vote button.";
    $serverdetails = "$servername is a Minecraft: PE server registered at $mcpelist. Probably by voting for this server you could receive rewards. <br> <br> If you wish, you can share the shortened URL with others to help the server owner get more players. It takes a few seconds and it's free.";
    $aboutmc-peus = "<p>mc-pe.us is a popular URL shortening service focused on Minecraft: PE voting pages. Our goal is to offer you a simple, modern and fast service so you can have the best experience shortening URLs.<br> <br>With a simple domain, easy to remember aliases, support of high quality in case of technical problems and last-level security, mc-pe.us has become one of the URL shorteners most chosen by server owners.</p>";
$footer = "<p class='lead'>Created and managed by <a target='_blank' href='https://kenygamer.com'>Kevin Andrews</a></p>";
?>
    
asked by Ricardo Zoido 08.04.2017 в 17:08
source

1 answer

2

The error PHP Parse error: syntax error, unexpected '=' in source_file.php on line 34 is received because in line 34 you have created a variable with the name $aboutmc-peus .

In PHP you can not create variables names with hyphen ( - ), since this is considered an operator to work with variables.

Quote extracted from the PHP documentation:

  

Variable names follow the same rules as other tags in PHP. A valid variable name has to start with a letter or underscore, followed by any number of letters, numbers and underscores.

Solution:

Change the name of the variables using:

  • Camel-case , example, $aboutmcPeus .
  • Guión bajo , example, $aboutmc_peus .
  • Etc.

More info: PHP - Variables

    
answered by 08.04.2017 в 17:25