Wednesday, March 16, 2011

What is an Array?

A variable is a storage area holding a number or text.The problem is,a variable will hold only one value.
An array is a special variable,which can store multiple values in one single variable.
If you have a list of items (a list of car names,for example),storing the cars in single variables could look like this:
$cars1="Saab";
$cars2="Volvo";
$cas3="BMW";

However,what if you want to loop through the cars and find a specific one?And wha if you had not 3 cars,bu 300?
The best solution here is to use an array!
An array can hold all your variable values under a single name.And you can access the values by refferingto the array name.
Each element in the array has its own index so that it can be easily accessed.
In PHP,there are three kinds of arrays:
 *Numeric array-An array with a numeric index.
 *Associative array-An array each ID key is assaociated with a value.
 *Multidimensinal array-An array containing one or more arrays.

9 comments:

  1. Acesoftech is a leading PHP training center which provides best training in Kolkata and Surat. The company provides training in such a way that its easy to learn and complete job oriented. We provide live PHP training.

    ReplyDelete
  2. Acesoftech is kolkata’s top PHP training center where professional php training is provided. The training is provided by not by the faculties but professionals who have already worked in this field. PHP is in demand, does that mean that its very easy to find job. And if its like that why there are hundreds of students how are jobless in spite of having knowledge of PHP? The reason is simple, they know php but they does not know it professionally. They have not been trained in proper way .
    Acesoftech trains in such a way that you can get job instantly because we trains the things which are in demand in the industry.
    If you are looking for professional PHP training in Kolkata, acesoftech guarantee you of building your career in PHP

    ReplyDelete
  3. We at W3 web School provide php training in Kolkata. So our training course in oriented for both live classes and also provide Online php training for who want to learn php and mysql from home at their comfort and convenience.
    http://www.w3webschool.com/phpmysql/
    Call Us:033-64506754

    ReplyDelete
  4. I really thankful to you for providing intro to array.


    php training in chandigarh

    ReplyDelete
  5. Acesoftech is a leading PHP training center which provides best training in Kolkata. The company provides training in such a way that its easy to learn and complete job oriented. We provide live PHP training in kolkata.

    http://www.acesoftech.in/phpmysql-training/

    Thanks

    ReplyDelete
  6. A variable is a storage area holding a number or text.The problem is,a variable will hold only one value.
    Industrial Training In Chandigarh
    PHP Industrial Training in Chandigarh

    ReplyDelete
  7. It is really interesting for me to read this article. Thanks for it. I like such topics and everything connected to them.

    web development company india

    ReplyDelete