$array = [
'23.2001',
'23.2000',
'01.2005',
'05.2020',
'01.2020',
'30.1998',
'03.2020',
'09.2020',
'04.1998',
'20.2005',
];
function camp($a, $b)
{
$a = explode('.', $a);
$b = explode('.', $b);
if ($a[1] == $b[1])
{
if ($a[0] < $b[0])
{
return -1;
} elseif($a[0] > $b[0])
{
return 1;
} elseif ($a[0] == $b[0]) {return 0;}
}
elseif ($a[1] < $b[1])
{
return -1;
} elseif($a[1] > $b[1])
{
return 1;
}
}
usort($array, 'camp');
foreach($array as $v)
{
echo $v . '<br>';
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://mysite.ru/post.php');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "name=john");
$out = curl_exec($curl);
echo $out;
curl_close($curl);
echo $_POST["name"];
echo "ДОШЛО";
die;
$login = $_POST['login'];
<input type="text" value="<?=$login?>">
$login = $_POST['login'];
file_get_contents('https://site.ru/?login='.$login);
$login = $_GET['login'];
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://mysite.ru/file.php');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "login=".$login);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
$group = '123456';
$token = '';
$query = 'https://api.vk.com/method/groups.getMembers?group_id=' . $group . '&count=1000&fields=bday,sex&access_token=' . $token . '&v=5.103';
$response = json_decode(file_get_contents($query));
foreach ($response->response as $key => $value) {
echo $value->id;
echo $value->bday;
echo $value->sex;
....
}
export function button1_click(event) {
$w('#text1').text = 'Hello world';
}
$getTable = $db->getAll('SELECT * from :product', [':product' => 'product']);
$ch = curl_init('https://api.um-agency.com/feed/tracks/get?pass_key=bamboo5e4d9fcf47abb&block_type=3&offset=0&count=100');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Accept: application/json", //
"User-Agent: VK_Music/4.2.1 (Android 4.2.4749 8.1.0)", // Получение списка топ 100 чарта вк, маскируясь под Boom
"Host: api.um-agency.com", //
"Accept-Encoding: utf-8",
"Connection: Keep-Alive"
));
$html = curl_exec($ch);
curl_close($ch);
$list_arr = json_decode($html);