How do I remove array elements with keys equal to a certain word in PHP?
<p>I have this  huge array:</p>

<pre><code>array(47) (
    "name" =&gt; string(0) ""
    "state" =&gt; string(7) "Alabama"
    "city" =&gt; string(0) ""
    "country" =&gt; string(13) "United States"
    "location" =&gt; string(0) ""
    "rooms" =&gt; string(0) ""
    "price" =&gt; string(0) ""
    "highlights" =&gt; array(5) (
        0 =&gt; string(0) ""
        1 =&gt; string(0) ""
        2 =&gt; string(0) ""
        3 =&gt; string(0) ""
        4 =&gt; string(0) ""
    )
    "specifications_type" =&gt; string(0) ""
    "specifications_lotsize" =&gt; string(0) ""
    "specifications_apn" =&gt; string(0) ""
    "specifications_interest" =&gt; string(0) ""
    "specifications_year" =&gt; string(0) ""
    "specifications_buildings" =&gt; string(0) ""
    "specifications_stories" =&gt; string(0) ""
    "specifications_corridors" =&gt; string(0) ""
    "financials_room" =&gt; string(0) ""
    "financials_other" =&gt; string(0) ""
    "financials_total" =&gt; string(0) ""
    "financials_multiplier" =&gt; string(0) ""
    "financials_caprate" =&gt; string(0) ""
    "financials_netincome" =&gt; string(0) ""
    "amenities_pool" =&gt; string(0) ""
    "amenities_fitness" =&gt; string(0) ""
    "amenities_quarters" =&gt; string(0) ""
    "amenities_services" =&gt; string(0) ""
    "amenities_spa" =&gt; string(0) ""
    "amenities_meetspace" =&gt; string(0) ""
    "amenities_parkspace" =&gt; string(0) ""
    "amenities_others" =&gt; string(0) ""
    "facilities_room" =&gt; string(0) ""
    "facilities_hvac" =&gt; string(0) ""
    "facilities_furnitures" =&gt; string(0) ""
    "facilities_tv" =&gt; string(0) ""
    "facilities_ref" =&gt; string(0) ""
    "facilities_microwave" =&gt; string(0) ""
    "consumables_resto" =&gt; string(0) ""
    "consumables_restocpct" =&gt; string(0) ""
    "consumables_barlounge" =&gt; string(0) ""
    "consumables_barloungecpct" =&gt; string(0) ""
    "consumables_bevrevenue" =&gt; string(0) ""
    "consumables_others" =&gt; string(0) ""
    "specifications" =&gt; string(100) "{"type":"","lotsize":"","apn":"","interest":"","year":"","buildings":"","stories":"","corridors":""}"
    "consumables" =&gt; string(89) "{"resto":"","restocpct":"","barlounge":"","barloungecpct":"","bevrevenue":"","others":""}"
    "amenities" =&gt; string(100) "{"type":"","lotsize":"","apn":"","interest":"","year":"","buildings":"","stories":"","corridors":""}"
    "facilities" =&gt; string(100) "{"type":"","lotsize":"","apn":"","interest":"","year":"","buildings":"","stories":"","corridors":""}"
    "financials" =&gt; string(100) "{"type":"","lotsize":"","apn":"","interest":"","year":"","buildings":"","stories":"","corridors":""}"
)
</code></pre>

<p>I want to remove the elements whose keys start with any of the following:
"specifications_", "amenities_", "facilities_", "consumables_", "financials_"</p>

<p>I have thought of using array_filter with a callback but I have no idea how to do things in the callback. Please help.</p>
