sam06 Posted August 17, 2009 Share Posted August 17, 2009 Any idea why I'm getting "parse error" for this on the echo implode... line? <?php $c = 50000; $m = (int)((sqrt($c))+1); $p = array_fill(2, $c-1, 1); $i = 2; while ($i<$m) { $j=$i*2; while($j<$c+1) { $p[$j] = 0; $j += $i; } $i++; } echo implode(’ ‘,array_keys($p, 1)); ?> Many thanks. Sam Quote Link to comment Share on other sites More sharing options...
DarkendSoul Posted August 17, 2009 Share Posted August 17, 2009 It looks like your using some sort of non-standard quotes... <?php $c = 50000; $m = (int)((sqrt($c))+1); $p = array_fill(2, $c-1, 1); $i = 2; while ($i<$m) { $j=$i*2; while($j<$c+1) { $p[$j] = 0; $j += $i; } $i++; } echo implode(' ',array_keys($p, 1)); ?> Are you using M$ Word or OpenOffice as a text editor? They tend to make your printed documents prettier by replacing quotes with special ones. For coding I would suggest using something like Notepad++ -> http://notepad-plus.sourceforge.net/uk/site.htm Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted August 17, 2009 Share Posted August 17, 2009 Are you using M$ Word or OpenOffice as a text editor? Yeah, they look like MS "smart" quotes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.