A PHP Error was encountered

Severity: Warning

Message: preg_match(): Compilation failed: unmatched closing parenthesis at offset 38

Filename: hooks/Check_user.php

Line Number: 222

Backtrace:

File: /home/b2z283hyjn3q/public_html/application/hooks/Check_user.php
Line: 222
Function: preg_match

File: /home/b2z283hyjn3q/public_html/application/hooks/Check_user.php
Line: 89
Function: getOS

File: /home/b2z283hyjn3q/public_html/application/hooks/Check_user.php
Line: 12
Function: anylisis

File: /home/b2z283hyjn3q/public_html/index.php
Line: 315
Function: require_once

Unknown What is array in php | PHP Tutorial for Beginners to Advance Full Course | part 14 | My Project HD
X

What is array in php | PHP Tutorial for Beginners to Advance Full Course | part 14

What is array in php | PHP Tutorial for Beginners to Advance Full Course | part 14





What is Array :

        array is a data structure that stores one or more similar type of values in a single value.

 

Example

       if you want to store 50 numbers then instead of defining 50 variables its easy to define an array of 50 length

 

$a = [1,2,3,4,5,6,7,8,..........50]

 

Types Of Array in PHP

  1. Numeric array

  2. Associative array

  3. Multidimensional array

 

1.Numeric array

   Syntex :

   $variable_name = array(value1,value2,value3.......,value n);

 

Example 1 :

   $a = array(1,2,3,4,5,6,7,8);

 

Example 2 :

    $b = array(a,b,c,d,e,f,g,h);

 

 

2.Associative array

  Syntex :

   $variable_name = array('key'=>'value','key'=>'value');

 

  Example :

  $user_info = array(

      'name'=>'your_name',

      'email'=>'your_email',

      'age'=>'your_age',

 );

 

3. Multidimensional array

  Syntex :

   $variable_name = array(

        'key'=>array('key'=>'value','key'=>'value'),

        'key'=>array('key'=>'value','key'=>'value'),

   );

 

  Example :

  $marks = array(

           'a' =>array('hindi'=>'60','english'=>'40'),

           'b' =>array('hindi'=>'60','english'=>'40'), 

  );

 

 

More Tutorials

Web Technology Tutorials in Hindi

Web Technology Tutorials in Hindi

Read More
Diploma engineering tutorial for polytechnic collage

Diploma Engineering Tutorial

Read More
Final Year Projects for Computer Science with Source Code

Final Year Projects for Computer Science with Source Code

Read More