Jump to content

[SOLVED] Multi-dimensional Array's


ShibSta

Recommended Posts

I have the following code and was wondering how I can display online the value of the title for each array, I am trying to get it to display the title | price | number in a row...

 

<td>Title: $value</td>

<td>Price: $value</td>

<td>Number: $value</td>

 

<?php
$array=array
(
array
	(
	Title => "rose",
	Price => 1.25,
	Number => 15
	),
array
	(
	Title => "daisy",
	Price => 0.75,
	Number => 25,
	),
array
	(
	Title => "orchid",
	Price => 1.15,
	Number => 7
	)
);
$array_rows=count( $array );
for( $row = 0; $row < $array_rows; $row++ )
{
foreach( $array[$row] as $key => $value )
{
	echo "$value";
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/49267-solved-multi-dimensional-arrays/
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.