Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error in writing variable

Tags:

php

I am writing this code in php

$a = 1 + 2 + 3 − 4 + 5;
echo $a;

getting error

Parse error: syntax error, unexpected '−' (T_STRING) in E:\xampp\htdocs\practice\test\index.php on line 2

what's the problem what's the right code

like image 319
Dinesh Avatar asked Feb 12 '23 17:02

Dinesh


1 Answers

Remove the operators and type them in again yourself. Looks like you copied them from somewhere and its not the correct operators php is expecting.

Eg. - and − are not the same thing.

like image 82
FMC Avatar answered Feb 14 '23 10:02

FMC