GinsBabu Posted November 26, 2009 Share Posted November 26, 2009 Hi.. i have an associative array with the n number of values of which one array name is location id.If location ID is having the same value in all the inner arrays i want to combine the results of the array ie having the same value.Any one knows solution for this.The purpose is like if the count is same and location id present are two 1's and one 2's then the corresponding values in 1's should be appended?how can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/ Share on other sites More sharing options...
JonnoTheDev Posted November 26, 2009 Share Posted November 26, 2009 Post the array contents Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966028 Share on other sites More sharing options...
GinsBabu Posted November 26, 2009 Author Share Posted November 26, 2009 This is the array.. Array ( [0] => Array ( [group_detail_id] => 2 [franchise_detail_id] => 7 [location_detail_id] => 13 [feed_location_stock_limit] => 10 [rule_parameter] => transmission_type_name [rule_type] => != [rule_match_value] => Automatic [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 44 ) ) Array ( [0] => Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => marque_name [rule_type] => = [rule_match_value] => Ford [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) [1] => Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => price [rule_type] => = [rule_match_value] => 10495 [rule_order] => 2 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) ) ... here the location id is same so i want the result as " marque_name=ford and price =10495" Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966030 Share on other sites More sharing options...
JonnoTheDev Posted November 26, 2009 Share Posted November 26, 2009 Can you post between pre tags. Can't make head or tail of that print "<pre>"; print_r($array); print "</pre>"; exit(); Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966032 Share on other sites More sharing options...
GinsBabu Posted November 26, 2009 Author Share Posted November 26, 2009 I am really sorry could show me way how you want to display it?.. These are the contents of that array Array ( [0] => Array ( [group_detail_id] => 2 [franchise_detail_id] => 7 [location_detail_id] => 13 [feed_location_stock_limit] => 10 [rule_parameter] => transmission_type_name [rule_type] => != [rule_match_value] => Automatic [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 44 ) ) Array ( [0] => Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => marque_name [rule_type] => = [rule_match_value] => Ford [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) [1] => Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => price [rule_type] => = [rule_match_value] => 10495 [rule_order] => 2 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) ) Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966034 Share on other sites More sharing options...
MisterWebz Posted November 26, 2009 Share Posted November 26, 2009 <?php Array ( ◦=> Array ( [group_detail_id] => 2 [franchise_detail_id] => 7 [location_detail_id] => 13 [feed_location_stock_limit] => 10 [rule_parameter] => transmission_type_name [rule_type] => != [rule_match_value] => Automatic [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 44 ) ) Array ( ◦=> Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => marque_name [rule_type] => = [rule_match_value] => Ford [rule_order] => 1 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) [1] => Array ( [group_detail_id] => 1 [franchise_detail_id] => 1 [location_detail_id] => 1 [feed_location_stock_limit] => 10 [rule_parameter] => price [rule_type] => = [rule_match_value] => 10495 [rule_order] => 2 [export_feed_detail_id] => 1 [rule_set_stock_limit] => 5 ) ) ?> Quote Link to comment https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966044 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.