Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.