-2

Please I can't figure out what is wrong with this line :

    echo "<tr><td>".substr($row['Vehicule_ID'], 0, - (strlen($row['Marque']) + 1)."</td><td>".$row['Marque']."</td><td>".$row['Modele']."</td><td>".$row['Couleur']."</td></tr>";

I have this error :

Unexpected ';'

Khalil Hamani
  • 71
  • 2
  • 3
  • 13
  • Possible duplicate of [PHP Parse/Syntax Errors; and How to solve them?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – u_mulder Dec 26 '15 at 16:58
  • Thank you @u_mulder this is not realy applicable in this case, but it's very helpful for furthur need. – Khalil Hamani Dec 27 '15 at 02:48

1 Answers1

0

You have a missing closing bracket after + 1. It is the closing bracket corresponding to the opening one of substr(.

And so PHP finds the semi-colon as being inside the last argument of substr, which is a syntax error.

trincot
  • 317,000
  • 35
  • 244
  • 286