isset() vs.empty()
???????? ??? ??????, ??? ?? ??? ????? ???? ?? ?????. ??? ??? ?? PHP?? ????? ???? ? ?? ??? isset() ?empty()???. ? ????? ? ??? ???? ???? ??? ?? ???? ???? ?? ??? ?????.
empty() ??
empty() ??? ??? ?? ??? ??? ????? ?????. isset()? ?? ??? ????? ??? ?? ??? ? ???, 0, null ? ?? ? ????? ?????.
?? ?? ?? ??? ?? ?? ??? ?????. ():
- ""(? ???)
- 0(??) zero)
- 0.0(?? ??? 0)
- "0"(??? 0)
- NULL
- FALSE
- ??( ) (? ??)
- class
isset() ??
empty()? ?? isset()? ?? ???? ??? ?????? ??? ?????. ??? ??? ?? ??? ??(null???) isset()? true? ?????. ?? isset()? null? ??? ??? ???? ?????.
isset() ?empty()? ???? ??
isset()?empty()?? ??? ?? ?? ??? ?? ????. . ??? ????? ???? ?? ?? ?? ???(0 ??) ???? ?? ???? empty()? ?????. ??? ?? ???? ??? ?? ??? ????? isset()? ?????.
??
?? ??? ?????.
$var = '23'; if (isset($var) && !empty($var)){ echo 'not empty'; } else { echo 'is not set or empty'; }
- ? ???? isset()? $var? ????? ????,empty()? ?? ??? ?????. $var? ?? ?? ?? ??? ?? ???? ???? ??? '?? ?? ??'? ???.
??? $var? null? ??? ?? isset()? true? ?????(?: ???), ?? ??()? true? ?????. ?? ??).
??:
empty() ??? ??? ?????? ???? ?? ??? ????? isset()?? ? ??????. ??? ?? ???? ??? ????? ??? ???? ??? isset()? ??? ?????.
? ??? `isset()`? PHP? `empty()` ??: ? ??? ?? ???? ????? ?? ?????. ??? ??? 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)

??? ??

PHP ??? ??????? ?? ??? ??? ??? ??? ?? ??? ?? ??? ????. ??? ?? ?????. 1. ?? PHP ?? ? ???? ??? ???? ?? ? ?? phpinfo.php ??? ???? ? ? ????. 2. ??? ? ??? ???? ??????. 8.2 ?? 8.1? ???? ?? ????. Linux ???? Package Manager? ???? MacOS ???? Homebrew? ?????. 3. ?? ?? ? ???? ???????? php.ini? ?????? ??? ??? ??????. 4. ? ???? ????? ?? ??? ????? ?? ??? ???? ??? ??? ??? ??????. ?? ??? ??? ???? ???? ?????? ????? ?? ? ? ????.

TosetupaPHPdevelopmentenvironmentonLinux,installPHPandrequiredextensions,setupawebserverlikeApacheorNginx,testwithaPHPfile,andoptionallyinstallMySQLandComposer.1.InstallPHPandextensionsviapackagemanager(e.g.,sudoaptinstallphpphp-mysqlphp-curlphp-mbst

PHP ?? ??? ????? ??? ??? ???? ??? ???? ???????. ?? ???? PHP ?? ???? ? ?? ?? ??? ?????. ? ?? (Apache ?? Nginx), PHP ?? ? ?????? (? : MySQL/MariaDB); ???? XAMPP ?? MAMP? ?? ?? ???? ???? ?? ????? ????? ?? ????. XAMPP? Windows ? MacOS? ?????. ?? ? ???? ??? HTDOCS ????? ???? LocalHost? ?? ??????. mAMP? MAC ????? ???? PHP ??? ??? ??? ????? ?? ???? ??? ???? ????. ④ ?? ???? MacOS/Linux ????? Homebrew? ???? ??? ? ????.

? ?? PHP ??? ???? ?? ? ?? ????? ? ?? ?? ??? ????. 1. ??? ??? ?? ?? ??? ?? Array_Merge ? Array_unique ??? ??????. ?? Array_Merge ($ array1, $ array2)? ?? ? ?? Array_Unique ()? ???? ?? ?? ? ?? ???? ? ??? ?????. 2. ?? ?? ? ? ?? ???? ? ? ?? ????? ???? ??????. $ result = $ array1 $ array2? ? ?? ??? ?? ? ?? ??? ?? ?? ?? ??????. ? ? ?? ??? ? ??? ????? ??? ?? ?

TopreventCSRFattacksinPHP,implementanti-CSRFtokens.1)Generateandstoresecuretokensusingrandom_bytes()orbin2hex(random_bytes(32)),savethemin$_SESSION,andincludetheminformsashiddeninputs.2)ValidatetokensonsubmissionbystrictlycomparingthePOSTtokenwiththe

????? ??? ????? ????? ??? ??? ???????. ?? ?? ??? ??? ????. 1. ??? 8 ?? ?????. 2. ??? ???, ??? ? ??? ?????. 3. ?? ?? ??? ?? ? ? ????. ?? ??? ????, ??? ???? ?? ? ??/?? ???? ?????, ?? PHP ?? ??? ?????. ???, ?????? ???? ?? ? 123456? ?? ???? ?? ??? ????????. ????? ?? ???? ????? ?? ZXCVBN ?????? ???? ?? ????.

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.
