# $citys массив городов, у которых есть poi.
# poi являются массивом в виде строки.
# calcRange
public function createdMatrix ($citys)
{
# Пробегаем грода
for ($i = 0; count($citys) > $i; $i++) {
$poi = $citys[$i]->poi;
$count_poi = count($poi);
for ($r = 0; $count_poi > $r; $r++) {
$data[$i][$r] = [];
for ($v = 0; $count_poi > $v; $v++) {
$sqrt = $this->calcRange($poi[$r]['coordinates'], $poi[$v]['coordinates']);
$data[$i][$r][] = $sqrt;
}
$data[$i][$r]['max'] = $this->maxHorizontSum($data[$i][$r]);
}
$data[$i]['max'][] = max($data[$i]);
}
return $data;
}
# Получаем разницу между точками
public function calcRange($cdr1, $cdr2)
{
$cdr1 = explode(',', $cdr1);
$cdr2 = explode(',', $cdr2);
$sqrt = sqrt(pow(( $cdr1[0] - $cdr2[0] ), 2) + pow(( $cdr1[1] - $cdr2[1] ), 2));
return round($sqrt, 6);
}
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $client_id . "&redirect_uri=" . urlencode($redirect)
. "&client_secret=" . $secret . "&code=" . $code;
// $code - ранее полученный код-токен
$response = file_get_contents($token_url);
//...
// теперь $response содержит ваш токен.
yii2 бекенд, а на JS+Node.JS+BEM фронтенд.
Хотелось бы бой между любителями PHP & Node.js
<img src="http://mysite/image.png" alt="" id="my_id" width="100" height="100">
$('img#my_id').attr('src');