Parse error: syntax error, unexpected T_SL on line 23

前端 未结 6 801
逝去的感伤
逝去的感伤 2021-01-01 12:27

I am getting this error:

Parse error: syntax error, unexpected T_SL on line 23

Here is line 23:

$selectorder =         


        
相关标签:
6条回答
  • 2021-01-01 12:50

    Also make sure that you have 3 '<<<'. Omitting one will throw this error. Also if your using NOWDOCs, make sure your hosting provider has php 5.3 installed. Plus if your php environment is below 5.3, do not use double quotes or single quotes.

    0 讨论(0)
  • 2021-01-01 12:52

    PHP Heredoc does not get on well with the % symbol, and the following also causes Parse error: syntax error, unexpected T_SL:

    <?php
    $var=<<<%%SHRUBBERY%%
    
    Nih!
    
    %%SHRUBBERY%%;
    ?>
    
    0 讨论(0)
  • 2021-01-01 12:59

    <<< is for heredoc: See manual

    0 讨论(0)
  • 2021-01-01 13:00

    Make sure that there is no SPACE/INDENTATION before ending ORDER;

    0 讨论(0)
  • 2021-01-01 13:09

    Check for whitespace after <<<ORDER. There should be no blank characters.

    0 讨论(0)
  • 2021-01-01 13:09

    It's called "Heredoc syntax", and it lets you specify large strings without using quotes. In this case, it looks like you're using it to put JavaScript code into a variable. Since you started the string with <<<ORDER, you should be able to finish it with ORDER;, as you have — but you need to make sure that ORDER; occurs at the start of a line, with no whitespace before it.

    0 讨论(0)
提交回复
热议问题