unexpected T_STRING, expecting ',' or ';' in
PHP Code:
<?php
$rainbow = new ColourGradient(array(
0 => ‘red’, 18.2 => ‘orange’, 32 => ‘yellow’, 50 => ‘green’,
68 => ‘blue’, 82 => ‘indigo’, 100 => ‘violet’
));
$text = 'THIS IS A TEST LINE';
$rainbow->SetRange(0, strlen($text)-1);
foreach($rainbow as $i => $colour)
echo “<span style=’color:$colour’>$text[$i]</span>”; // Line 17
?>
Re: unexpected T_STRING, expecting ',' or ';' in
Quote:
echo “<span style=’color:$colour’>$text[$i]</span>”; // Line 17
“ and ” characters are not ASCII Doublequote. Replace “ and ” characters with " (ASCII doublequote).
Replace ‘ and ’ characters with ' (ASCII singlequote) too.
I guess you have copy pasted the code from a word document (or from some website) where they've replaced ASCII characters with non-ASCII pretty characters.