This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |