Jump to content

Join array


GinsBabu

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/183044-join-array/
Share on other sites

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"

Link to comment
https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966030
Share on other sites

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 ) )

 

 

Link to comment
https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966034
Share on other sites

<?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 ) ) 

?>

Link to comment
https://forums.phpfreaks.com/topic/183044-join-array/#findComment-966044
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.