echo htmlspecialchars($bc, ENT_QUOTES);
#[^\p{Cyrillic}a-zA-Z0-9]#u
<?php
$pcreReflector = new ReflectionExtension("pcre");
$pcreReflector->info();
каким-то образом также раскодировать
# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r".*?([0-9]+)\s?м².*"
test_str = "1-к квартира, 39 м², 1/5 эт."
subst = "\\1"
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE | re.UNICODE)
if result:
print (result)
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
а вот и основной код, точнее php часть
<?php
require_once('config.php'); // <- session_start(); внутри
?>
<!doctype html>
<html>
<head></head>
<body>
<?php
if(empty($_SESSION['token'])){
echo " <a href='https://oauth.vk.com/authorize?client_id=".$appid." &display=page&redirect_uri=".$redirect_url."&scope=".$scope."&response_type=code&v=5.62
' >Вход по вк </a> " ;
}
else{
$go = "https://api.vk.com/method/users.get?fields=photo_50&https://api.vk.com/method&v=5.52&access_token=" . $_SESSION['token'];
$ku = curl_init();
curl_setopt($ku, CURLOPT_URL, $go);
curl_setopt($ku, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ku, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ku, CURLOPT_RETURNTRANSFER, TRUE);
$result = json_decode(curl_exec($ku));
$ava=$result->response[0]->photo_50;
$first_name=$result->response[0]->first_name;
$last_name=$result->response[0]->last_name;
$id=$result->response[0]->id;
echo "$bal ";
echo "$first_name";
echo "<a href = 'https://vk.com/id".$id."'><img src='".$ava."'></a></br>";
echo " <a href='logout.php' >Выход </a> " ;
}
?>
</body>
</html>
function DescOrderArray($array, $field)
{
uasort($array, function ($b, $a) use ($field) {
return strnatcmp($a[$field], $b[$field]);
});
return $array;
}
function AscOrderArray($array, $field)
{
uasort($array, function ($a, $b) use ($field) {
return strnatcmp($a[$field], $b[$field]);
});
return $array;
}
$name = isset($_POST['name']) ? $_POST['name'] : '';
$s_name = isset($_POST['s_name']) ? $_POST['s_name'] : '';
$address = isset($_POST['address']) ? $_POST['address'] : '';
$post_index = isset($_POST['post_index']) ? $_POST['post_index'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';