i have an array $ results, which gives me following output when i do print_r on it.
Array (
[0] => Array (
[parent_geo_zone_id] => 3
[name] => UK VAT Zone
[shipping_pool_geo_zone_id] =>
[email] =>
)
[1] => Array (
[parent_geo_zone_id] => 4
[name] => UK Shipping
[shipping_pool_geo_zone_id] =>
[email] =>
)
[2] => Array (
[parent_geo_zone_id] => 5
[name] => Texas
[shipping_pool_geo_zone_id] => 5
[email] => ammar.instantsoft@gmail.com
)
[3] => Array (
[parent_geo_zone_id] => 6
[name] => florida
[shipping_pool_geo_zone_id] => 6
[email] => ammar_ul_hasan@hotmail.com
)
[4] => Array (
[parent_geo_zone_id] => 7
[name] => alaska
[shipping_pool_geo_zone_id] =>
[email] =>
)
)
I want to compare the following indexes
'parent_geo_zone_id' and 'shipping_pool_geo_zone_id '
like this
if($results->array['parent_geo_zone_id']==$results->array['shipping_pool_geo_zone_id '])
where ever these two ids are equal i want to send my checkbox value as checked to view other wise unchecked like this.
foreach ($results as $result) {
$this->data['geo_zones'][] = array(
'geo_zone_id' => $result['parent_geo_zone_id'],
'name' => $result['name'],
'email' => $result['email'],
'selected' => isset($this->request->post['selected']) && in_array($result['geo_zone_id'], $this->request->post['selected'])
);
I am using open cart.