Skip to content

Instantly share code, notes, and snippets.

View eslavon's full-sized avatar
🏠
Working from home

Eslavon eslavon

🏠
Working from home
  • Vinogradov Victor
  • Ivanovo & Crimea
View GitHub Profile
@eslavon
eslavon / filtration.php
Last active October 17, 2019 14:21
Удаление элемента из многомерного массива
<?php
$ids = array_column($array, "address");
$ids = array_unique($ids);
$result_array = array_filter(
$array,
function ($key, $value) use ($ids) {
return in_array($value, array_keys($ids));
},
ARRAY_FILTER_USE_BOTH
);
@eslavon
eslavon / test.php
Last active October 3, 2019 00:06
Геокодер
<?php
$search = "Иваново,Лежневская улица 155";
$url = "http://search.maps.sputnik.ru/search/addr?q=".$search."apikey=5032f91e8da6431d8605-f9c0c9a00357";
$url = urlencode($url);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
@eslavon
eslavon / func_random_key.php
Created February 3, 2019 16:35
func_random_key
<?php
function keyGenerate($leight) {
if (is_int($leight)) {
$array = array("1", "2", "3", "4", "5", "6", "7", "8", "9","0",
"A","B","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
$count = count($array)-1;
$result = "";
for ($i = 1; $i <= $leight; $i++) {
$random = mt_rand(0,$count);