...

View Full Version : why i could not print value?



kamkam
05-16-2008, 01:01 PM
Hi:
why my following code could not print out value?



$mystring="nationalize running going";

$mystr = split(" ",$mystring);
$max=sizeof($mystr);

$i=0;
while($i<$max){
echo $mystr[i];
$i++;
}

_Aerospace_Eng_
05-16-2008, 01:28 PM
You should be getting an error. You used i in your while loop instead of $i.

echo $mystr[$i];
Turn on error_reporting in the development stage. Put this at the top of your php.

error_reporting(E_ALL);

kamkam
05-17-2008, 07:20 AM
You should be getting an error. You used i in your while loop instead of $i.

echo $mystr[$i];
Turn on error_reporting in the development stage. Put this at the top of your php.

error_reporting(E_ALL);

Thanks a lot.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum