Results: 1022
Default title of the html page
Default title will be the name of the html page if it's untitled (meaning if the title is not provided)
Late static binding with attribute CODE
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();
Third party cookie example
Create third party cookie (
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));
Array KEY outside of LOOP
$key
is useful outside of the
foreach
loop
$array = ['key1'=>1234, 'key2'=>2345, 'key3'=>3457];
foreach ($array as $key => $item) {
	
}
echo $key; // key3
control how a webpage is displayed on different devices by adjusting the width and initial zoom level of the viewport to match the device's screen size
<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 applied
Difference between route:clear and route:cache
php 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 dynamically
cURL Request example
Makes
cURL
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"
strtotime
The following expressions return the same time
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
12<img src="https://sibrdzne.ge/d1_images/logo.png" alt="Logo" class="image">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam a nunc at ante eleifend tempor. In vel ullamcorper tellus, et vulputate metus. Integer pulvinar, ipsum in efficitur fringilla, dolor lacus sollicitudin tortor, vitae tincidunt nunc elit id ipsum. Proin laoreet, est ut placerat sollicitudin, lectus mi pellentesque est, vel accumsan velit sem id felis.
<p>New P</p>
$password = "your_password";
Hash the password with cost factor
9
$start9 = microtime(true);
$hash9 = password_hash($password, PASSWORD_BCRYPT, ['cost' => 9]);
$end9 = microtime(true);
$executionTime9 = $end9 - $start9;
Hash the password with cost factor
10
$start10 = microtime(true);
$hash10 = password_hash($password, PASSWORD_BCRYPT, ['cost' => 10]);
$end10 = microtime(true);
$executionTime10 = $end10 - $start10;
Calculate the speedup factor
$speedupFactor = $executionTime10 / $executionTime9;

// Display the hashed passwords, execution times, and speedup factor
echo "Hashed password with cost 9: " . $hash9 . "\n";
echo "Execution time with cost 9: " . $executionTime9 . " seconds\n\n";
echo "Hashed password with cost 10: " . $hash10 . "\n";
echo "Execution time with cost 10: " . $executionTime10 . " seconds\n\n";
echo "Speedup factor (9 vs 10): " . $speedupFactor . " times faster\n";
Results: 1022