Jump to content

PHP syntax error


TottoBennington

Recommended Posts

ERROR MESSAGE:

 

Parse error: syntax error, unexpected '(' in C:\xampp\htdocs\cart\cart.php on line 6

 

<?php
function  cart() {
 foreach($_SESSION as $name => $value) {
     if ($value>0) {
	      if (substr($name, 0, 5) == 'cart_') {
		      $id = substr ($name,5 (strlen($name) -5));
			  echo  $id;
		  } 
	     
	 } else {
	      echo 'your cart is empty';
	 }
 }
}
?>
[code/]

Link to comment
https://forums.phpfreaks.com/topic/257342-php-syntax-error/
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.