PHP Array is a type of data structure used to store several elements of similar types of data in a single variable. They are useful for creating a list of similar types of elements that can be accessed using their index or key. For example, if you want to store 200 numbers then it's easy to define a 200 length array instead of defining 200 variables. PHP includes mainly three types of array:
Indexed or Numeric Array : The PHP index array is defined by the number of elements starting from 0 and ends a number of element -1. In the PHP array, we can store numbers, string, and object. By default, all elements in the PHP are assigned to an index number. It is used for building an array in PHP. Inside these multiple values can be passed separately by comma(,). Syntax: array(value1,value2..) Mainly, there are two methods to define indexed array: 1st method: $courses=array("PHP","HTML","CSS","Boostrap"); 2nd method: $courses[0]="PHP"; $courses[1]="HTML"; $courses[2]="CSS"; $courses[3]="Boostrap"; There are two methods for defining the indexed array but the same output is shown. Associative Array: In terms of functionality, the associative arrays functions are very similar to numeric arrays but differ in terms of their index. Associative array will have its index as string so that a clear association between key and values can be formed. Using (= >) sign to identify index and values within this association. There are two methods to define the associative array: 1st method: $salary=array("Ashi"=>"350000","Tina"=>"450000","Abhi"=>"200000"); 2nd method: $salary["Ashi"]="350000"; $salary["Tina"]="450000"; $salary["Abhi"]="200000"; There are two methods for defining the associative array but the same output is shown. Nesting Array(Multi-Dimensional array): A multidimensional array or nested array function is an array that stores a different array at each index, instead of a single value. In simple words, A multidimensional array is a set of arrays. PHP Multidimensional array may be expressed in the form of a matrix represented by a row*column. Syntax: array(array(val1, val1, val2..), array(val1,val2,val3..)) Read More.... Also, Visit here if you want to learn Codeigniter - Codeigniter Tutorial
25 Comments
9/11/2022 04:25:25 pm
Really informative article, I had the opportunity to learn a lot, thank you. https://kurma.website/
Reply
9/30/2022 11:52:05 am
It's great to have this type of content. Good luck with your spirit. Thank you. https://bit.ly/site-kurma
Reply
10/4/2022 07:47:45 pm
I think this post is useful for people. It has been very useful for me. Looking forward to the next one, thank you. https://escortnova.com/escort-ilanlari/tokat-escort/erbaa-escort/
Reply
10/6/2022 05:48:59 am
I support your continuation of your posts. I will be happy as new posts come. Thank you. https://escortnova.com/escort-ilanlari/zonguldak-escort/alapli-escort/
Reply
10/7/2022 08:15:01 am
I think the content is at a successful level. It adds enough information. Thank you. https://escortnova.com/escort-ilanlari/denizli-escort/bozkurt-escort/
Reply
10/7/2022 02:23:48 pm
Thank you for your sharing. I must say that I am successful in your content. https://escortnova.com/escort-ilanlari/sakarya-escort/karasu-escort/
Reply
10/8/2022 09:16:31 am
Thoughtful and real content is shared. Thank you for these shares. https://escortnova.com/escort-ilanlari/trabzon-escort/vakfikebir-escort/
Reply
11/22/2022 08:21:27 pm
Hemen Göz At evde para kazanmaya basla: https://sites.google.com/view/evden-ek-is/
Reply
12/10/2022 05:43:00 pm
Düşmeyen bot takipçi satın al: https://takipcialdim.com/
Reply
12/10/2022 08:03:12 pm
İnstagram beğeni satışı yapan firmamıza göz atın: https://takipcialdim.com/instagram-begeni-satin-al/
Reply
12/10/2022 08:04:29 pm
Tiktok takipçi satın almak için tıkla: https://takipcialdim.com/tiktok-takipci-satin-al/
Reply
12/16/2022 01:15:07 pm
takipçi satın al ve sitemizi ziyaret et: https://takipcim.com.tr/
Reply
12/19/2022 09:49:25 pm
İnstagram takipçi satın almak istiyorsan tıkla.
Reply
1/5/2023 04:56:47 am
100 tl deneme bonusu veren siteleri öğrenmek istiyorsan tıkla.
Reply
Leave a Reply. |