0
$team = trim(split("are", $string)[0]); // Line 215 

this code has syntax error but i can't solve this :(

Parse error: syntax error, unexpected '[' in /home/zz.php on line 215

and When I define varible like this

$array = [ "a", "b", ]; 

Parse error: syntax error, unexpected '['

too

5
  • What version of PHP are you using? Commented Apr 21, 2018 at 17:55
  • version is PHP 5.2.17 Commented Apr 21, 2018 at 17:56
  • $team = trim(split("are", $string)[0]); code is working some times ago but suddenly don't work :( Commented Apr 21, 2018 at 17:57
  • You can't define arrays using square brackets prior to PHP 5.4 Commented Apr 21, 2018 at 17:57
  • split is also deprecated in 5.3 and removed as of PHP 7. Use explode Commented Apr 21, 2018 at 18:00

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.