|
-
May 6th, 2009, 03:05 AM
#1
Thread Starter
Lively Member
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
?>
-
May 6th, 2009, 06:49 AM
#2
Re: unexpected T_STRING, expecting ',' or ';' in
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.
Last edited by iPrank; May 6th, 2009 at 06:54 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|