Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
public $config = array();
private $items = array();
private $names = array();
private $prices = array();
private $qtys = array();
private $urls = array();
private $subtotal = 0;
private $itemCount = 0;
can any body please explain what the meaning of above code. in the first line its says class Jcart in my other index.php file, the thing is i am learning php and so i downloaded this code and try to understand it but i got stuck in these lines. and i dont understand why he wrote it that way, please explain
Posted
Comments
Sergey Alexandrovich Kryukov 19-Aug-13 19:38pm    
Bad idea, really. Do you know how many pieces of code you can get from the Web and stare it it. Why wasting time? Read some programming manual, write your own code and ask questions if you face some problems...
Or ask the person who wrote this.
—SA
Mohibur Rashid 19-Aug-13 23:09pm    
my suggestion would be open a book or look for site that explains array function and how class are declared in php

These variables are initializing. "array()" returns empty array.
 
Share this answer
 
Read this

PHP: Arrays - Manual[^]
 
Share this answer
 
following are type:-

1.$config
2.$items
3.$names
4.$prices
5.$qtys
6.$urls

all are declare empty array.


followings are declare as 0
$subtotal,$itemCount
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900