1/3 페이지 열람 중
sprintf%0.8s <=== ?? <?php $ext = 'png'; $filename = 'filename'; echo sprintf('%s_%s.%0.8s', date("YmdHis"), $filename, $ext); // 20230104105802_filename.png echo '<br>'; echo sprintf('%s_%s.%0.2s', date("YmdHis"), $filename, $ext); // 20230104105917_filenam…
[PHP] function(){} 함수 안에 function(){} 함수 가능. ① -> ② <?php final class FileUploadAction { ① public function __invoke(Request $request, Response $response) { ② function moveUploadedFile(string $directory, UploadedFileInterface $uploadedFile) { //... //moveUploade…
Multiple constructors in PHPhttps://www.amitmerchant.com/multiple-constructors-php/ <?php class Animal { public function __construct() { $arguments = func_get_args(); $numberOfArguments = func_num_args(); if (method_exists($this, $function = '__construct'.$numberOfArgument…
<?php declare(strict_types=1); //모니터 제조스펙 인터페이스 interface IMonitorMaker { public function makeProduct(); } //모니터 제조스펙 데이타모델 class MonitorModel { public string $name; public int $size; function __construct($name, $size) { $this->name = $name; $this->size …
array option append <?php $origin_array=['0'=>'v0','1'=>'v1']; function optionTest(array $options = []) { $options += [ '3' => 'v3', '4' => 'v4', '5' => 'v5', '6' => 'v6', '7' => false, ]; return $options; } var_dump(optionTest($origin_…
composer create-projectslim/slimprojectnamehttps://www.youtube.com/watch?v=FYQrMr7oDv0&ab_channel=TylerPottsPSR ? =>PHP Standard Recommendation=PHP 표준 권고(PSR) = PHP 규약 제정=최근 :PSR-7HTTP Message Interfacehttps://www.lesstif.com/laravelprog/php-psr-24445325.htmlSlim Framework 4 - Quick Starthttp…
composer2.51 + php8(xampp) + slim4Slim 4 Documentationhttps://www.slimframework.com/docs/v4/[Windows 환경][composer 설치]https://getcomposer.org/download/1. php.exe 파일 위치 확인 - [ XAMPP 설치환경임]D:\xampp\php\php.exe2.Composer-Setup.exe 설치 중 아래 오류 메시지----------------------Program Output:Xdebug: [Step Debug] T…
The Simplest PHP Router[PHP 프레임워크 미 사용]아래 처럼 1번).htaccess 생성 방법으로 할수 있으나 성능 상 비권장 => 2번) 방법을 이용□ 1번)웹사이트 루트디렉토리에(index.php와 같은 위치).htaccess 파일생성RewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php [NC,L][참고]Apache mod_rewrite Introduct…
https://tcpschool.com/php/php_basic_datatypehttps://inpa.tistory.com/entry/PHP-%F0%9F%93%9A-%EB%B3%80%EC%88%98-%EC%83%81%EC%88%98-%ED%83%80%EC%9E%85MySQL데이터베이스에 PDO(PHP Data Object)https://offbyone.tistory.com/1
PHP8 + php_xdebug-3.x + Visual Studio Code Debugging1) phpinfo.php 파일로 서버에 설치된 phpinfo 페이지 로드 -> 로드화면 전체복사(CTRL+A)<?phpphpinfo();?>https://xdebug.org/wizard.php <- 이곳에 붙혀넣기해서 분석 후 제안되는php_xdebug-3.1.6-8.1-vs16-x86_64.dll 다운로드-> apm서버 php확장라이브러리 폴더에 다운 받은 dll 복사 ex)D:/xampp/php/ext 에 d…