Echo Array Value

How can I echo the array value?

Here is the pre…


=> Array

        [count] => 2


Here is my currrent code…

Code: [Select]

<span class=“blue”><?php echo $count; ?></span>

Can I do this without using a foreach loop?

Yes you can print without using foreach loop, with the help of index number.

echo $ variablename[0];
echo $ variablename[1];
echo $ variablename[2];
echo $ variablename[3];

some thing like that.


Why you gave space between $ and variablename[0],variablename[1],variablename[2],variablename[3]

Try Like this;

echo $variablename[0];
echo $variablename[1];
echo $variablename[2];
echo $variablename[3];

To answer your question unemployment, you can access that value with:-

$count = $array[0]['count'];