Link to home
Start Free TrialLog in
Avatar of ellandrd
ellandrdFlag for Ireland

asked on

unexpected T_DOUBLE_ARROW


$query = array('counties' => 1,'page' => $selected_page_num,'min_price' => $min_value,'max_price' => $max_value,'sort_by' => 'price');

$property_types = array('house','apartment','duplex','bungalow');
                  
array_push($query,'property_type' => $property_types);   <-------------ERROR LINE

I've tried searching on Google for a solution but I don't understand the suggested fixes.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

http://php.net/manual/en/function.array-push.php

array_push($query,'property_type',  $property_types);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ellandrd

ASKER

OK but I don't understand, or should I say you've confused me a little with the array_push() capability now?

I knew I can do:

array_push($array,array('value' => $value));

and

array_push($array,$value);

Which both push values into the Array $array but I didn't know I can push values into the Array $array using:

array_push($array,'value',$value);

Cool!

Thank you!