Results 1 to 2 of 2

Thread: unexpected T_STRING, expecting ',' or ';' in

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    84

    unexpected T_STRING, expecting ',' or ';' in

    PHP Code:

    <?php


    $rainbow 
    = new ColourGradient(array(
        
    => ‘red’18.2 => ‘orange’32 => ‘yellow’50 => ‘green’,
        
    68 => ‘blue’82 => ‘indigo’100 => ‘violet’
    ));


    $text 'THIS IS A TEST LINE';


    $rainbow->SetRange(0strlen($text)-1);


    foreach(
    $rainbow as $i => $colour)
         echo 
    <span style=’color:$colour’>$text[$i]</span>// Line 17

    ?>

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width