Skip to content

Tag: php

php foreach array id value

i have array: array( id1: title_of_id_1, id2: title_of_id_2, id3: title_of_id_2, ) How to foreach get array only list id1, id2, id3? Answer You didn’t provided proper source code of your array. So I couldn’t understand properly I think, still I’m trying to answer. If your ID number and text …

Elasticsearch sort, substitute a missing field with another

I have some products I would like to sort by price. They have two properties, product_price and a special_price. special_price is not always present in the doc. On reading the documentation it looks like you can add a missing element and have it search on this instead. I’ve added the following to the re…