PHP GET method doesn't work in Xampps
<p>I'm a newbie in PHP and I'm confused about GET method.</p>

<p>Why the <code>$text</code> in the condition of the loop works with Appserv in Windows 7, but when I tried this code with Xampps on Mac it won't work I've to use <code>for($i=0; $i&lt;strlen($_GET['text']); $i++)</code> instead.</p>

<p>At first, I understand that after I used <code>isset($_GET['text'])</code> so next time I just use only <code>$text</code>, but now I'm confused.</p>

<pre><code>&lt;? $color = array("#FFCCFF", "#FFCCCC", "#FFCC99", "#FF99FF", "#FF99CC",
    "#FF9999", "#FF66FF", "#FF66CC", "#FF6699", "#FF6666");
if (isset($_GET['text'])) { 
    for($i=0; $i&lt;strlen($text); $i++) { 
        $j = $i%10 ?&gt;
        &lt;font color=&lt;?= $color[$j]?&gt;&gt;&lt;? echo "$text[$i]"; ?&gt;&lt;/font&gt;
    } 
} else {
    echo "Empty String";
} ?&gt;
</code></pre>

<p>The problem is <strong>solved</strong> by many of your help.</p>

<pre><code>&lt;?php $color = array("#FFCCFF", "#FFCCCC", "#FFCC99", "#FF99FF", "#FF99CC",
    "#FF9999", "#FF66FF", "#FF66CC", "#FF6699", "#FF6666"); 
if( isset($_GET['text'])) {
    $text = $_GET['text'];
    for( $i=0; $i&lt;strlen($text); $i++) {
        $j = $i%10;
        echo "&lt;font color=$color[$j]&gt;$text[$i]&lt;/font&gt;";
    }
} else
    echo "Empty string";
?&gt;
</code></pre>

<p>btw I'm trying to use HTML + PHP only because I want to practice with HTML before go in deep with CSS.</p>
