[Solved] Getting parse error, unexpected T_ELSE(else), expecting ‘}’ [duplicate]


It’s possibly line 261, the _RAMA line needs to be unindented:

                        <td>$download_link</td>
                        </tr>
_RAMA;
                $count++;

When using heredoc syntax, the terminator needs to be the only thing on that line (no trailing spaces) and at the start of the line (no indentation).

The _RAMA was indented, so PHP didn’t think the string ended and gobbled up lines after that as part of the string literal.

Use an IDE that syntax highlights to easily spot when a string is unexpectedly un-terminated:

Note how the green "string" color goes past the _RAMA line

Note how the green “string” color goes past the _RAMA line

1

solved Getting parse error, unexpected T_ELSE(else), expecting ‘}’ [duplicate]