Jump to content

Foreach


3raser

Recommended Posts

Keep getting a parse error?

 

Parse error: parse error in C:\wamp\www\learning\loops.php on line 12

 

<?php

$array;
$array[0] = "1";
$array[1] = "7";
$array[2] = "3";
$array[3] = "4";
$array[4] = "3";

$variable = "3";

foreach($array as => $variable) 
	{
	$number = 1 + $number;
	 echo $number;
	}

?>

 

and what is $variable? I think you meant to put $number there

Link to comment
https://forums.phpfreaks.com/topic/205756-foreach/#findComment-1076708
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.