|
 Rahul - 2017-03-11 12:32:23
Parse error: syntax error, unexpected '[' in /Applications/XAMPP/xamppfiles/htdocs/wrd/wordsearch.php on line 76
private function search($grid, $row, $col, $word)
{
$x = [ -1, -1, -1, 0, 0, 1, 1, 1 ]; //Line 76
$y = [ -1, 0, 1, -1, 1, -1, 0, 1 ];
What is the significance of 0 , -1, 1
Thanks
 Ravindu Taveesha - 2017-03-11 14:08:02 - In reply to message 1 from Rahul
please check your php version, after php 5.4 you can use the short array syntax, which replaces array() with []. if you version is lower than 5.4 replace them with array().
x,y are eight direction coordinates for an example, N(0,1), E(1,0), S(0,-1), W(-1,0)
 Rahul - 2017-03-11 16:17:21 - In reply to message 2 from Ravindu Taveesha
Hi I have 5.6.27 running built Oct 23 2016.
After changing[ to ( I get
Parse error: syntax error, unexpected ',' in /Applications/XAMPP/xamppfiles/htdocs/wrd/wordsearch.php on line 76
 Ravindu Taveesha - 2017-03-12 02:44:01 - In reply to message 3 from Rahul
This is syntax error, can i see your code ?
|