// для echo $someProperty;
0000 EXT_STMT
0001 T0 = FETCH_OBJ_R THIS string("someProperty")
0002 ECHO T0
0003 EXT_STMT
// для echo $this->someProperty;
0000 EXT_STMT
0001 T1 = FETCH_OBJ_R THIS string("someProperty")
0002 ASSIGN CV0($someProperty) T1
0003 EXT_STMT
0004 ECHO CV0($someProperty)
0005 EXT_STMT
$content = hex2bin(str_replace(" ","", "25 50 44 46 2D 31 2E 35 0D 0A 25 B5 B5 B5 B5 0D 0A 31 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 43 61 74 61 6C 6F 67 2F 50 61 67 65 73 20 32 20 30 20 52 2F 4C 61 6E 67 28 72 75 2D 52 55 29 20 2F 53 74 72 75 63 74 54 72 65 65 52 6F 6F 74 20 32 32 20 30 20 52 2F 4D 61 72 6B 49 6E 66 6F 3C 3C 2F 4D 61 72 6B 65 64 20 74 72 75 65 3E 3E 3E 3E 0D 0A 65 6E 64 6F 62 6A 0D 0A 32 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 50 61 67 65 73 2F 43 6F 75 6E 74 20 31 2F 4B 69 64 73 5B 20 33 20 30 20 52 5D 20 3E 3E 0D 0A 65 6E 64 6F 62 6A 0D 0A 33 20 30 20 6F 62 6A 0D 0A 3C 3C 2F 54 79 70 65 2F 50 61 67 65 2F 50 61 72 65 6E 74 20 32 20 30 20 52 2F 52 65 73 6F 75 72 63 65 73 3C 3C 2F 45 78 74 47 53 74 61 74 65 3C 3C 2F 47 53 35 20 35 20 30 20 52 2F 47 53 36 20 36 20"));
// если записать в каталог сервера, то так:
file_put_contents("file.pdf", $content);
// если отдать контент браузеру, то так:
header("Content-type:application/pdf");
header("Content-Disposition:inline;filename='file.pdf");
echo $content;
echo Carbon::now()->subMinutes(2)->locale('ru_RU')->diffForHumans(); // '2 минуты назад'
shell_exec
+ chromium
с флагами headless
disable-gpu
и print-to-pdf
отрисует вам что угодно, что может отобразить chrome.$tel = '79000000000';
$formatted = preg_replace(
'/(\d)(\d{3})(\d{3})(\d{2})(\d{2})/',
'+$1 ($2) ***-**-$5',
$tel
);
var_dump($formatted);
$formatted = preg_replace(
'/(\d)(\d{3})(\d{5})(\d{2})/',
'+$1 ($2) ***-**-$4',
$tel
);
$formatted = preg_replace(
'/^(\d)(\d{3})\d+(\d{2})$/',
'+$1 ($2) ***-**-$3',
$tel
);
<?php
class config {
public $start_time = '1670000999';
public $email = 'support@domain.zone';
public $adm_dir = 'FolderAdm';
public $adm_name = 'Admin';
public $adm_pass = '00000000';
}
$configFile = './core/cfg_test.php'; //доступность файла оставим на совести автора вопроса
$cfg = new config();?>
<form method="post">
<?php
foreach ($cfg as $key=>$value) {?>
<input name="<?=$key?>" value="<?=$value?>">
<?php }?>
<button type="submit">do marasm</button>
</form>
<?php
if($_SERVER['REQUEST_METHOD']=="POST"){
$new_cfg = (Object)$_POST;
file_put_contents($configFile, var_export($new_cfg,1));
}
?>
$work_time = [
'work_start_time'=>'09:30',
'work_end_time'=>'18:20',
'dinner_start_time'=>'13:30',
'dinner_end_time'=>'14:00',
];
$answer = 'Closed';
$date = str_replace(':','',$work_time);
$now = date('Hi');
if( $date['work_start_time'] <= $now && $now <= $date['work_end_time'] ) $answer = 'Now we open';
if( $date['dinner_start_time'] <= $now && $now <= $date['dinner_end_time'] ) $answer = 'Now we on break';
echo $answer;