Php sorting of massives by id
There are two masses, offers (10-30):
by {
The “offers”: [
“ID” is “235”.
“Name”: “Crezu”
“img_src”: “/offerimgs/Crezu_400-300.jpg”,
“max_sum” is “20000”
“min_srok”: “7”
“max_srok”: “30”
“stack”: “0.01”
The “action”:
and the
by {
“id”: “189”
“Name”: “Online Loans PH”,
“img_src”: “/offerimgs/OnlineLoans_400-300.jpg”,
“max_sum” is “7000”
“min_srok”: “1”
“max_srok”: “90”
“stack”: “0.01”
The “action”:
and the
)
and id (organic and facebook){"organic":{{"id":"235"},{"id":"189"},{"id":"166"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"392"},{"id":"405"},{"id":"189"},{"id":"166"},{"id":"235"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"387"},{"id":{"id":{"id":{"id":{id":{{id}}}}}}}}}}}}}}}}}}}}}}}
You need to set offers (sort) by id, offers are removed through the cycle.1 .The number of IDs and Offers can be different.But in the final mass should only be those offers that we have.We allow 10 offers and only 4 ids.Therefore, we show 4 offers in a certain order.2ndThere should be a clear way to choose a massive of offers (organic or facebook) in the example.For example, $offers_ids['organic'] , $offers_ids['facebook'].+
You need to add the off-of-off function by id, now it is there but the option is not the best.For example, I indicate the id-shek mass.
$remove_ids = array(189, 223)
And if offers with these id are present in the mass of offers then we exclude them.
by PHP 5.5.
Source with all connections - transfer to the executive
There are two massives, offers (10-30 pieces):
by {
The “offers”: [
“ID” is “235”.
“Name”: “Crezu”
“img_src”: “/offerimgs/Crezu_400-300.jpg”,
“max_sum” is “20000”
“min_srok”: “7”
“max_srok”: “30”
“stack”: “0.01”
The “action”:
and the
by {
“id”: “189”
“Name”: “Online Loans PH”,
“img_src”: “/offerimgs/OnlineLoans_400-300.jpg”,
“max_sum” is “7000”
“min_srok”: “1”
“max_srok”: “90”
“stack”: “0.01”
The “action”:
and the
)
and id (organic and facebook){"organic":{{"id":"235"},{"id":"189"},{"id":"166"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"392"},{"id":"405"},{"id":"189"},{"id":"166"},{"id":"235"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"387"},{"id":{"id":{"id":{"id":{id":{{id}}}}}}}}}}}}}}}}}}}}}}}
You need to set offers (sort) by id, offers are removed through the cycle.1 .The number of IDs and Offers can be different.But in the final mass should only be those offers that we have.We allow 10 offers and only 4 ids.Therefore, we show 4 offers in a certain order.2ndThere should be a clear way to choose a massive from the massive id-shake (organic or facebook) in the example.For example, $offers_ids['organic'] , $offers_ids['facebook'].+
You need to add the off-of-off function by id, now it is there but the option is not the best.For example, I indicate the id-shek mass.
$remove_ids = array(189, 223)
And if offers with these id are present in the mass of offers then we exclude them.
by PHP 5.5.
Source with all connections - transfer to the executive
Добрый вечер,
Есть два массива, офферы (10-30 штук):
{
"offers": [
"id": "235",
"name": "Crezu",
"img_src": "/offerimgs/Crezu_400-300.jpg",
"max_sum": "20000",
"min_srok": "7",
"max_srok": "30",
"stavka": "0.01",
"akcia": ""
} ,
{
"id": "189",
"name": "Online Loans PH",
"img_src": "/offerimgs/OnlineLoans_400-300.jpg",
"max_sum": "7000",
"min_srok": "1",
"max_srok": "90",
"stavka": "0.01",
"akcia": ""
} ,
]
и id (organic и facebook)
{"organic":[{"id":"235"},{"id":"189"},{"id":"166"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"392"},{"id":"405"}],"facebook":[{"id":"189"},{"id":"166"},{"id":"235"},{"id":"21"},{"id":"316"},{"id":"324"},{"id":"337"},{"id":"387"},{"id":"392"},{"id":"405"}]}Данные приходят в JSON-е, после чего я их декодирую через json_decode
Нужно выстроить офферы (отсортировать ) по id, офферы выводятся через цикл.
1. Количество id и офферов может быть разное. Но в окончеательном массиве должны быть только те офферы, ид которых у нас есть. Допустим 10 офферов и всего 4 id. Следовательно показываем 4 оффера в определенном порядке.
2. Должен быть явный способ выбрать массив из массива id-шек (organic или facebook) в примере. Например $offers_ids['organic'] , $offers_ids['facebook'].
+
Нужно добавить функцию исключения офферов по id, сейчас она есть но вариант не лучший.
К примеру я указываю массив id-шек
$remove_ids = array(189, 223);
И если офферы с этими id присутствую в массиве офферов то мы их исключаем
php 5.5.
Исходник со всеми подключениями - передам исполнителю
Current freelance projects in the category PHP
Execution of work after SEO audit
334 USD
An experienced OpenCart developer is needed to perform SEO and technical improvements for the online store. Main tasks: Correction of the internal linking structure and menu. Adding links to the footer. Implementation of breadcrumbs with Schema.org microdata. Fixing the… PHP, Website Maintenance ∙ 1 day 16 hours back ∙ 52 proposals |
Fix issues with Facebook API in the OpenCart moduleIn OpenCart, there is a module for integrating Facebook and Instagram via API, OAuth, and Webhook. After opening the module page in the browser, the number of API requests to Facebook starts to increase, and the number of errors gr:get:InvalidID also rises. It is necessary to… PHP, Web Programming ∙ 1 day 17 hours back ∙ 34 proposals |
Integration needed: KeyCRM → Cash Register KashalotIt is necessary to set up integration between KeyCRM and the Cash Register Kahalot. When placing an order in KeyCRM, the data must be automatically transmitted to Kahalot: • order information • products, nomenclature • prices • quantity More details in private. Content Management Systems, PHP ∙ 4 days 13 hours back ∙ 29 proposals |
A WordPress site using the Kadence theme and Kadence Blocks.
223 USD
We need to create a website on WordPress using the Kadence theme and Kadence Blocks. There will be no online store (although it may be added in the future). We need a homepage and several internal pages. The graphics are already prepared, the layout structure is mostly defined,… Content Management Systems, PHP ∙ 5 days 22 hours back ∙ 38 proposals |
Development of 2 SEO-oriented websites for selling spare parts (ATVs and special equipment)Development of Two Specialized Websites for Selling Spare PartsGeneral Information It is necessary to develop two specialized websites: Spare parts for ATVs, UTVs, SSVs, and other similar equipment. Spare parts for special equipment. Existing company website:… PHP, Web Programming ∙ 6 days 19 hours back ∙ 77 proposals |