??? PHP? ??? ??? PSR-12?? ??? ??? ????. ?? PHP ?????? ?? ?? ?????? ?? ?? ? ???? ??? ?????? PHP ?????? ???? ???? ?? ??? ???. ???? ???? ?? ???? ???? PSR-12? ??? ??? ? ????, ?? ??, ?? ???? ?????. ? ?????? PSR-12? ????, ? ????, ????? PSR-12? ???? ??? ?? ??? ???????.
??
- PSR-12? ??????
- PSR-12? ? ??????
-
PSR-12? ?? ??
- ?? ??
- ?????? ? ?? ??
- ??? ? ???
- ?? ??
- ?? ? ??
- PSR-12? PHP ????? ???? ??
- PSR-12? ??? ? ??? ?? ??
- ?? ??
PSR-12? ??????
PSR-12? PHP-FIG(Framework Interoperability Group)?? ??? PHP? ?? ??? ??????. ?? PSR-2 ??? ???? ???? ?? PHP ??? ???? ????? ??? ???? ????? ????? ?? ??? ?????.
PSR-12? ???? ?? ?? ?? ?? ??? PHP ?? ??? ?? ????? ??? ???. PSR-12? ??? ???? ??? ??? ???? ??? ????? ??? ? ???? ?? ??? ? ?? ???? ?? ?? ????? ??? ? ????.
PSR-12? ? ??????
PSR-12? ?? ?? ??? ?? ??? ?? ?? ??? ???? ?? ????. ??? ??? ??? ????.
- ???: ?? ???? ??? ??? ?? ????? ?? ??? ???? ?? ??? ? ????.
- ??: ??? ??? ??? ??? ?? ????? ?? ? ???? ???? ???.
- ?????: ???? ??? ??? ??? ??? ?? ???, ??? ? ??? ? ????.
- ?? ???: ?? ?? ?????? ?? ?? ?????? ??? ? ?? ??? ??? ??? ????? ?? ???? ?????.
PSR-12? ?? ??
PSR-12? ???? ? ?? ?? ??? ???????. ?? ??? ??? ?? ?? ?? ??? ??? ????.
1. ?? ??
- ?? ??: PHP ???
- ???: ??? BOM(??? ?? ??) ?? UTF-8? ?????? ???.
- ? ??: ?? 120?? ??? ? ??? ?? 80?? ?????.
- ? ?: ?? PHP ?? ?? ?? ?? ??? ? ?? ??? ???. ?? return ? ?? ??? ?? ???? ? ?? ?? ??? ???.
2. ?????? ? ?? ??
PSR-12??? ???? ??? ?? ??????? ?? ??? ?? ??? ??? ???.
- ?????? ??: ?????? ??? ?? PHP ?? ??? ? ?? ???? ???. ?????? ??? ? ?? ?? ??? ???.
- ?? ??: ?? ?? ??? ?????? ?? ??? ?? ????? ? ?? ????? ???. ?? ??? ??? ??? ? ?? ?? ??? ???.
?:
<?php namespace App\Controllers; use App\Models\User; use App\Repositories\UserRepository; class UserController { // Class implementation }
3. ???? ???
PSR-12? ???, ?? ? ??? ?? ??? ?? ? ?? ??? ??? ?????.
- ??? ??: ??? ??? ??? ??? ??? ??? ?? ???. ?? ??? {? ??? ??? ?? ?? ????? ??, ?? ??? }? ? ?? ??? ???.
- ??: ?? ??? ?? ???(??, ??, ???)? ???? ???.
- ???: ??? ??? ???? ?? ??? ??? ??? ?? ? ???? ??? ??? ?? ???. ?? ???? ?? ???? ???? ???.
class UserController { private $userRepository; public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; } } <h4> 4. ?? ?? </h4> <p>if, for, switch? ?? ?? ??? ?? ??? ??? ???.</p> <ul> <li> <strong>??</strong>: ?? ???? ?? ?? ??? ??? ?? ??? ???. ? ? ??? ??? {}? ?? ???? ???.</li> <li> <strong>????</strong>: ?? ?? ??? ?? ??? ? ??(????? ?? 4?)?? ??????? ???. </li> </ul> <pre class="brush:php;toolbar:false">if ($user->isAdmin()) { echo "User is an admin"; } else { echo "User is not an admin"; }
5. ?? ? ??
???? ??? ?? ??? ???? ??? ???? ? ?? ?????. PSR-12? ???? ??? ??? ???? ?????.
- ?? ??: ?? ?? ???? /* */? ???? ?? ?? ? ?? ????.
- ? ? ??: ??? ???? //? ???? ??? ??? ??? ?????.
<?php namespace App\Controllers; use App\Models\User; use App\Repositories\UserRepository; class UserController { // Class implementation }
PHP ????? PSR-12? ???? ??
?????? PSR-12? ???? ??? ??? ? ??? ???? ??? ? ??? ?? ??? ???? ?? ?? ??? ???? ??? ???? ????.
?? ??? ?? ???? ??? ?????.
- ???? ???? ??: ?????? ?? 4?? ?????.
- ? ?? ??: ?? 120? ???? ?????. ?, ???? ???? 80?? ?????.
- ?? ?? ??: ??? ??, ??? ? ?? ??? ?? ??? ????.
PSR-12? ??? ? ??? ?? ??
??? PSR-12? ???? ???? ???? ?? ??? ?? ?? ? ??? ? ????? ????? ? ??? ?? ??? ????.
1. PHP_?????
PHP ??? PSR-12? ???? ?? ?? ?? ?? ?? ? ??? PHP_CodeSniffer???. ??? ???? ???? ???? ??? ?????.
?? ? ?? ??:
class UserController { private $userRepository; public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; } }
?? ?? ??? ?? ?????.
if ($user->isAdmin()) { echo "User is an admin"; } else { echo "User is not an admin"; }
2. PHP CS ??
? ?? ??? ??? PHP CS Fixer???. ??? ??? ?? ??? ???? PSR-12? ????? ??? ??? ?? ????.
// Fetch user from the repository $user = $userRepository->find($id); /* * If user is not found, throw an exception. * This helps in handling invalid user IDs. */ if (!$user) { throw new NotFoundException(); }
??? ???? Fixer? ?????.
composer require "squizlabs/php_codesniffer=*"
3. PHPStorm
PHPStorm? ???? ?? PSR-12? ???? ??? ? ????. ???? ?? -> ??? -> ?? ??? -> PHP ??? PSR-12? ?????.
?? ??
PHP ?????? PSR-12? ??? ?? ??? ??? ??? ???? ? ?????. ?? ???? ?? ?? ???? ???? ??? ? ????, ?? ??, ?? ???? ?? ??? ????. PSR-12? ??? ???? ??? ?? PHP ????? ?? ??? ???? ???.
? ??? ???? ?? ????? ???? ?? ??? ??? PHP ??? ???? ?? ?????. ??? ??? ???? ????? ? ?? ??? ????? ??? ???? ????? ??? ???!
??? ?????!
? ??? PSR ?? - PHP ?? ??? ???? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











TOSECURELYHANDLEAUSTENCENDACTIONANDACTERIZINGINPHP, FORCUCTSESTEPS : 1. ALWAYSHASHPASSWORTHPASSWORD_HASH () ? VERVERIFYUSINGPANSWORD_VERIFY (), usePREPAREDSTATEMENTSTOPREVENTSQLINGERGED, andSTOREUSERSESSEATAIN $ _SESSIONSAFTERLOGIN.2.impleplempletrole ?? ACCESSC

PHP?? ?? ???? ???? ????? ??? ?? ??? ???? ?? ??? ??? ??? ???? ????. 1. finfo_file ()? ???? ?? ?? ??? ???? ???/jpeg? ?? ?? ?? ? ?????. 2. uniqid ()? ???? ??? ?? ??? ???? ? Web ?? ????? ??????. 3. php.ini ? html ??? ?? ?? ??? ???? ???? ??? 0755? ?????. 4. Clamav? ???? ???? ???? ??? ??????. ??? ??? ?? ???? ????? ???? ?? ??? ????? ???? ??? ? ??? ?????.

PHP?? ==? ==? ?? ???? ?? ??? ??????. == ?? ??? ?? ?? ?????. ?? ??, 5 == "5"? true? ????, ?? ??? ???? ?? ?? ??? ????? ????? (? : 5 === "5"? false? ?????. ?? ?????? ===? ? ???? ?? ?????? == ?? ??? ??? ???? ?????.

PHP?? ?? ??? ??? ???? ??? ??? ????. 1. ?? ??? ?? ? ?? ??? ??? ???? ???? ??? ? ????. ??? ??? ???? ????? ????? ???? ????. 2. ?? ?? ?? - ??, ??? ???? ?? ??? ?????. 3. ?? ???? ??? ??? ???? ??? ??? ?????. 4. Division? / ??? ???? 0?? ??? ?? ????? ??? ?? ??? ?? ? ? ????. 5. ???? ??? ???? ?? ?? ? ?? ??? ???? ? ??? ? ???, ??? ?? ? ? ??? ??? ???? ?????. ? ???? ???? ???? ??? ??? ??? ???? ?? ??? ? ??????? ????.

tostaycurrentwithphpdevelopments ? bestpractices, followkeynewssources lifephp.netandphpweekly, adgytwithcommunitiesonforumsandconferences, readlingupdated andgrad indewfeatures, andreadorcontributetoopensourceproceprosts.first

?, PHP? ?? ?? ?? ?????? ?? MongoDB ? Redis? ?? NOSQL ??????? ?? ??? ? ????. ?? MongoDBPHP ???? (PECL ?? Composer? ?? ??)? ???? ????? ????? ??? ?????? ? ???? ????? ??, ??, ?? ? ?? ??? ?????. ??, Predis ????? ?? Phpredis ??? ???? Redis? ???? ?? ? ?? ? ??? ???? ??? ????? Phpredis? ???? ?? Predis? ?? ??? ?????. ? ? ?? ??? ???? ? ????? ????.

phpbecamepupularforwebdevelopmentduetoiteofleneflening, whithhtml, wididepreadhostingsupport, andalargeecosystemincludingframeworkslikelaravelandcmsplatformsformslikewordpress.itexcelsinhandlingformsubmissions, managingussess, interptisussivers, ?? ???

TOSETTHERIGHTTIMEZONEINPHP, usedate_default_timezone_set () functionattStartOfyourscriptwitHavalidInlifiersuchas'America/new_york'.1.edate_default_timezone_set () beforeanydate/timeFunctions.2
