Beginner Friendly · Hands-on · Free

index array in PHP tamil -linto.in

index array in php is stores the value by using index by default. php index array என்பது array-ல் store செய்யகூடிய ஒவ்வொரு value-ம் index number-ஐ வைத்து தான் store செய்யபடுகிறது.

5 min read Updated Dec 02, 2025

Index array in php tamil

php index array என்பது array-ல் store செய்யகூடிய ஒவ்வொரு value-ம் index number-ஐ வைத்து தான் store செய்யபடுகிறது. array என்றால் default-ஆக index array-ஆக தான் இருக்கும்.

Note: இந்த array-ல் numbers, strings or any object-ஐ store செய்துகொள்ள முடியும். இதை numaric array என்றும் அழைக்கபடுகிறது

Index array example

<?php
// type-1
$fruits=array("grapes","banana","orange");
echo $fruits[0]."<br>";
echo $fruits[1]."<br>";
echo $fruits[2]."<br>";

// type-2
$currency[0]=10;
$currency[1]=20;
$currency[2]=50;
$currency[3]=100;
$currency[4]=200;
$currency[5]=500;
$currency[6]=2000;

echo $currency[0]."<br>";
echo $currency[3]."<br>";
echo $currency[6]."<br>";

?>
Output 1:
grapes
banana
orange
Output 2:
10
100
2000

Traversing PHP Indexed Array

foreach loop-ன் மூலம் php index array-வை easy-ஆக traverse செய்யமுடியும்.

<?php
$fruits=array("grapes","banana","orange","apple","pineapple");

foreach($fruits as $fruit){
	echo $fruit."<br>";
}
?>
Output:
grapes
banana
orange
apple
pineapple

Count Length of PHP Indexed Array

count() function-ன் மூலம் php index array-ல் உள்ள element-களின் எண்ணிக்கையை கண்டறிய முடியும்.

<?php
$fruits=array("grapes","banana","orange","apple","pineapple");

	echo count($fruits);

?>
Output:
5
இது பற்றிய தங்களின் கருத்துகளை இங்கே பதிவிடுங்கள் . இது பயனுள்ளதாக விரும்பினால் மற்றவர்களுக்கும் இதை share செய்யுங்கள்.