Re: Any ideas on combining arrays????

From: Date: Wed, 03 Apr 2002 17:45:54 +0000
Subject: Re: Any ideas on combining arrays????
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-91337@lists.php.net to get a copy of this message
See, Scott.. It is all about your logic. For instance, you can create a nice multidimentional array like this: Array( '0'=>Array(
		'data'=>Array(     // your whole data array
.... data .... data .... data ),
		'parameters'=>Array(     // the settings rlative to data array
'count'=>'256', 'type_of_data'=>'strings', 'came_from_DB'=>'PostgreSQL', 'came_from_table'=>'thisTable' 'etc'=>'bla...bla..bla..' ) ), '1'=>Array(
		'data'=>Array(     // your whole data array
.... data .... data .... data ),
		'parameters'=>Array(     // the settings rlative to data array
'count'=>'258', 'type_of_data'=>'integers', 'came_from_DB'=>'mySQL', 'came_from_table'=>'thatTable' 'etc'=>'bla...bla..bla..' ) ), ... etc....etc...etc... ); in this way you can loop the whole thing, access the data by refering to the 'data' subarray and then get the parameters (counts, types whatever you want) by accessing 'parameters' subarray containing the relative settings for that very array. As I said in the very first line - all up to your logic and the organization rules within the code. Hope it is of any help to you. Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) www.PHPBeginner.com maxim@phpbeginner.com Scott Fletcher writes:
Hi!
    Need some ideas on combining some arrays into one!  I have array for
data and other array for counter. How do I make an array that would show different data for each counter number? -- clip -- $FFR = array (
      "TU4R"      => array( "data" => "", "count" => "" ),
      "PH01"      => array( "data" => "", "count" => "" ),
); -- clip --
    The response should look something like this when I pick the correct
data and correct count; 
$FFR["TU4R"]["data"]["0"]["count"] = "TU4R is 0"; $FFR["TU4R"]["data"]["1"]["count"] = "TU4R is 1"; $FFR["TU4R"]["data"]["2"]["count"] = "TU4R is 2";
    I tried to do something like this but it doesn't work.  I have been
working for 2 days trying to figure it out. I appreciate any help you can provide for me. Thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) www.PHPBeginner.com maxim@phpbeginner.com

« previous php.general (#91337) next »