troubleshooting Question

fundamental PHP foreach question!

Avatar of Colin Brazier
Colin BrazierFlag for United Kingdom of Great Britain and Northern Ireland asked on
7 Comments2 Solutions272 ViewsLast Modified:
Weird!  Hopefully this is an easy 1000 points for someone.

This is taken straight from the manual, and I get an error - anyone see it?  I'm using CodeIgniter if that's relevant at all.

syntax error, unexpected '$v' (T_VARIABLE) in C:\xampp\htdocs1\fobg\application\controllers\week_fixtures.php on line 31

public function date_chosen()
            $a = array(1, 2, 3, 17);

            foreach ($a as $v) {
                echo "Current value of \$a: $v.\n";

also flagged up in Dreamweaver:
DW screenshot
Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros