/id:(.*?) submit date:(.*?) done date:(.*?) stat:(.*?) err:(.*)/
The result of the above format is:7439722864896249924 sub:001 dlvrd:001
/id:(.*?) (?:sub:\d+ dlvrd:\d+ )?submit date:(.*?) done date:(.*?) stat:(.*?) err:(.*)/
The result:7439722864896249924
function 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));
HTML
`
<div class="container">
<div class="item">Home</div>
<div class="item">Shop</div>
<div class="item">About</div>
<div class="item">Contact</div>
CSS
.container {
display: flex;
padding: 2rem 3rem;
gap: 2rem;
border-radius: 1 rem;
CSS
Select any .item that is not hovered, but is inside a .container which has an .item that is hovered
.item {
color: #ffffff;
transition: color 300ms;
}
.container: has(.item:hover)
.item:not(:hover) {
color: #888888;
}
// Example usage:
$year = 2023;
$month = 1; // May
function generateMonthArray($year, $month) {
$numDays = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$firstDay = date("N", strtotime("$year-$month-01")); // 1 = Monday, 7 = Sunday
$weekdays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
$monthArray = array_fill_keys($weekdays, []);
for ($day = 1; $day <= $numDays; $day++) {
$weekday = ($firstDay + $day - 2) % 7; // Adjust to start from Monday
$monthArray[$weekdays[$weekday]][] = $day;
}
foreach ($monthArray as &$weekDays) {
if ($weekDays[0]!=1) {
array_unshift($weekDays, '');
} else {
break;
}
}
return $monthArray;
}
$result = generateMonthArray($year, $month);
// Print the result
foreach ($result as $weekday => $days) {
echo $weekday . "\t" . implode("\t", $days) . "\n";
}