[Nfb-web] is something wrong with this code?

Wunder, Gary WunderG at health.missouri.edu
Thu Dec 21 15:19:49 CST 2006


Does the following string need a $ before choice?

if(strchr($parsestring,"choice")) 

-----Original Message-----
From: nfb-web-bounces at nfbnet.org [mailto:nfb-web-bounces at nfbnet.org] On
Behalf Of Ryan Mann
Sent: Thursday, December 21, 2006 3:18 PM
To: nfb-web at nfbnet.org
Subject: [Nfb-web] is something wrong with this code?

Hello.  Can anybody tell me if something is wrong with this code?
PHP says that there is an invbalid value for foreach.
Here is the code.
if(strchr($parsestring,"choice"))
{
$choices=array(substr($parsestring,7));
while(strchr($parsestring,"end of choices")!=0)
{
$choicenum=$choicenum+1;
print $choicenum;
$choices[$choicenum]=substr($parsestring,7);
}
}
print "Now printing the choices."."<br>";
foreach($choices as $choicepos)
{
print $choicepos."<br>";
}

The extra print statements are for debuging purposes.
Thanks for your help.
Ryan

_______________________________________________
Nfb-web mailing list
Nfb-web at nfbnet.org
http://www.nfbnet.org/mailman/listinfo/nfb-web


More information about the Nfb-web mailing list