Jump to content

PHP -Array Help


pdtest

Recommended Posts

Am trying to use Array in my PHP Script with foreach loop......

 

foreach ($ratiolist[$index] as $ratio_index=>$ratio_value)

{   

     

$ratio=$ratio_value->ratio;

echo "$ratio";

}

 

This works fine and I get the value of ratio from the array.....

 

 

Question: I do not want to use foreach loop and hence How can I extract the $ratio_value  value ? I tried the following:

$ratio=$ratiolist[$index]

echo "$ratio";

 

Results: It says its an Array.....

 

Any Suggestions ? Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/146229-php-array-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.