Tpes of array in php

About This Presentation
Title:

Tpes of array in php

Description:

Arrays in PHP is a type of data structure that allows us to store multiple elements of similar data type under a single variable.Mainly There are three types of array 1. Indexed arrays - Arrays with a numeric index. 2. Associative arrays - Arrays with named keys. 3. Multidimensional arrays - Arrays containing one or more arrays. To know more visit here – PowerPoint PPT presentation

Number of Views:13

less

Transcript and Presenter's Notes

Title: Tpes of array in php


1
Types of Array in PHP
https//training.phptpoint.com/php-training-noida.
php
2
Since 2007 phptpoint is the best php training
institute in Noida and successfully trained
10000 students in php and other programming
languages like python ,HTML, Mysql and all.
Today we will discuss about types of an array and
data types in php.
https//training.phptpoint.com/php-training-noida.
php
3
PHP Data Types
In PHP we use data types to hold different types
of data or values. PHP supports eight primitive
data types can be categorized further in 3 types
  • Scalar Types
  • Compound Types
  • Special Types

PHP Data Types Scalar Types
  • In PHP there are 4 scalar data types.
  •  
  • boolean
  • integer
  • float
  • string

https//training.phptpoint.com/php-training-noida.
php
4
PHP Data Types Compound Types
  • In PHP there are 2 compound data types.
  •  
  • array
  • object

PHP Data Types Special Types
  • In PHP there are two special data types in PHP.
  •  
  • resource
  • NULL
  •  

https//training.phptpoint.com/php-training-noida.
php
5
Lets Understand about Array in PHP!! 
Arrays in PHP is a type of data structure which
allows us to keep or we can say multiple elements
of similar data type under a single variable with
we can save much time and effort of creating a
different variable for every data. The arrays are
helps to create a list of elements of similar
types, which can be accessed using their index or
key. Like, we want to store five names and print
them accordingly. This could be easily done by
the use of five different string variables. But
if instead of five, the number rises to hundred,
then it would be really difficult for the users
to create many different variables. Here array
comes into play and helps us to keep and store
every element within a single variable and also
allows easy access using an index or a key. An
array is created using an array()function with
PHP.
https//training.phptpoint.com/php-training-noida.
php
6
C program to find minimum or the smallest element
in array. This prints the location or index in
which the minimum element occurs in an array.
Example-
If you have a lists of few items (a list of bikes
names, for example), storing the cars in single
variables could look like this
Lets practice this!!
cars1 "Volvo"cars2 "BMW"cars3
"Toyota"
How Many types of Array we have in PHP?
There are three types of Array.
https//training.phptpoint.com/php-training-noida.
php
7
Indexed or Numeric Arrays An array with numeric
index place where values are stored
linearly.     Associative Arrays An array with
string index place where instead of linear
storage, each value can assigned a specific
key.     Multidimensional Arrays An array who
contains single or many array within it and can
accessed via multiple indices.
What is an Indexed or Numeric Arrays?
Indexed or Numeric type of arrays can be used to
store any type of elements, but an index is
always a number.   By default, index starts at
zero.
https//training.phptpoint.com/php-training-noida.
php
8
What is Associative Arrays?     Associative type
of arrays is almost same to the indexed arrays
but instead of linear storage, every value can be
assigned with user-defined key of string type.
What is Multidimensional Arrays?
  Multi-dimensional arrays are such arrays which
stores another array at every index instead of
single element. In another words, we can
define multi-dimensional arrays as array of
arrays. As the name suggests, every element in
this array can be an array and they can also hold
other sub-arrays within. Arrays or sub-arrays in
multidimensional arrays can be accessed using
multiple dimensions.   I hope you all are bit
clear about the DATA TYPE and ARRAY in PHP to
 learn more visit at www.phptpoint.com
https//training.phptpoint.com/php-training-noida.
php
9
Original Source
Contact Us
0120-4968730 91 8588829328 91 9625950080
Call us
H-73, Sector-63, Noida(Opposite Electronic City
Metro Station)
Locate us
https//training.phptpoint.com/php-training-noida.
php
Write a Comment
User Comments (0)