×
Clear all filters including search bar
Valeri Tandilashvili's Personal Professional Blog
<br>
and <hr>
tags are called single tags or empty elementsfunction getString(&$ar, $maxlen = 255, $firstRead = false, $encoding = 3)
{
$s = "";
$i = 0;
$rep = 1;
if ($encoding == 8) {
$rep = 2;
}
do {
$c = 0;
for($rc = 0; $rc < $rep; $rc ++) {
$c += ($firstRead && $i == 0) ? current($ar) : next($ar);
$i++;
}
if ($encoding == 8) {
if ($c >= 224 && $c <= 256) {
$c += 4080;
}
}
if ($c != 0) {
$s .= mb_chr($c);
}
} while ($i < $maxlen && $c != 0);
return $s;
}
$ar = unpack("C*", hex2bin('0001013939353539383235313533340000013930323237000000000000000008004a004800650079002010d010d110d210d310d410d510d610d710d810d910da10db10dc10dd10de10df10e010e110e210e310e410e510e610e710e810e910ea10eb10ec10ed10ee10ef10f00204000200a2'));
$service_type = getString($ar, 6, true); // 6
$source_addr_ton = next($ar); // 7
$source_addr_npi = next($ar); // 8
$source_addr = getString($ar, 21); // 29
$dest_addr_ton = next($ar); // 30
$dest_addr_npi = next($ar);
$destination_addr = getString($ar, 21); // 52
$esmClass = next($ar);
$protocolId = next($ar);
$priorityFlag = next($ar);
next($ar); // schedule_delivery_time
next($ar); // validity_period
$registeredDelivery = next($ar);
next($ar); // replace_if_present_flag
$dataCoding = next($ar); // 60
next($ar); // sm_default_msg_id
$sm_length = next($ar);
$message = getString($ar, $sm_length, false, $dataCoding);
var_dump('encoding: '.$dataCoding, 'length: ' . $sm_length, 'msg:' . $message);
class a {
const OPERATOR_ID = 0;
public function test(){
echo self::OPERATOR_ID;
echo static::OPERATOR_ID;
}
}
class b extends a {
const OPERATOR_ID = 1;
}
(new b())->test();
setcookie.php
):$result = setcookie('cooname', 'V37', [
'expires' => time() + 3600,
'path' => '/',
'domain' => '.sibrdzne.ge',
'httpOnly' => true,
'secure' => true,
'SameSite' => 'None'
]);
Receive cookie from another domain (getcookie.php
):header('Access-Control-Allow-Origin:'.$_SERVER['HTTP_ORIGIN'] ?? '*');
header('Access-Control-Allow-Credentials:true');
echo $_COOKIE['cooname'] ?? 'no-cookie';
Pass cookie and fetch content from another domain (from console):fetch('https://sibrdzne.ge/getcookie.php', {
credentials:'include'
}).then(e=>e.text()).then(e=>console.log(e));
$key
is useful outside of the foreach
loop$array = ['key1'=>1234, 'key2'=>2345, 'key3'=>3457];
foreach ($array as $key => $item) {
}
echo $key; // key3
<meta name="viewport" content="width=device-width, initial-scale=1">
width=device-width
- sets the width of the viewport to be equal to the width of the device's screen. This ensures that the webpage adapts and fills the entire width of the device, regardless of its specific screen size or resolution. CSS media query
works properly with any device by setting device width to viewport
initial-scale=1
- sets the initial zoom level when the webpage is first loaded. A value of 1 means that the webpage will be displayed at a 1:1 ratio, without any zooming or scaling appliedphp artisan route:cache
This command will generate a cached version of our routes.
Once the routes are cached, Laravel
will use the cached version instead of parsing and compiling the routes on each request, which helps to improve the overall performance of your application
When we make changes to our routes, we need to regenerate it to reflect the updated routes
php artisan route:clear
This command will remove the cached routes, and the application will revert to parsing and compiling the routes dynamicallycURL
request
To http://10.0.0.1/api/sms?PersonalID=19011111114
With headers:
Channel-Name: SMS
Authorization: 9s2EkGCDhv3eVwQY5BPSc
curl -H "Channel-Name: SMS" -H "Authorization: 9s2EkGCDhv3eVwQY5BPSc" "http://10.0.0.1/api/Sms?PersonalID=19011111114"
echo strtotime("2031-05-28T00:00:00").PHP_EOL;
echo strtotime("2031-05-28 00:00:00").PHP_EOL;
echo strtotime("2031-05-28").PHP_EOL;
The result is:1937692800
1937692800
1937692800