GetText? PHP ? ???? ?? ????? ???? ????? ??? ??? ????. Apache Caches Translations? ??? ?? ???? ??? ?? ? ??? ?? ????? ???? ????. ??? ??? ??? ? ?? ??? ??? ?? ???? ?? ??????.
- ? ?????? ?? ????? ???? CC By-NC 4.0 ????? ?? ????? ??? ????? PHP 5.3 ??? ?????. ? ?? ?? ??? updatetranslation ()??, ?? ??? ?? ? ??? ???? DeleteOldTranslations ()? ?? ?? ??? ??? ??? ?? ??? ?? ??? ???? DeleteOldTranslations ()???.
-
?? ???? ?? ?? ??? ? ????? ?? ? ????. ? ??? ?? ? ???? ?? ??? ??? ?? ? ???? ??? ????. ????? ??? ???? ?? ??? ??? ? ??? ??? ???? ? ??? (?? ???? ???? ??)? ??? ???? ???? ? ?? ????. ????? ???? ???? ?? ??? ??? ??? ??? ???? ?? ? ???? ???? ?? ??? ?????. PHP?? ?? ???? ??? getText? ?? ????. ?? ?? ?????? ??? ???? ????? ???? ?????? ??? ??? ??????. ??? Apache? ??? ????? ????. ??? ?? ??? ? ??? ?? ??? ?? ????? ???? ????. ? ??? ?? ??? ????? ??? ??? ??? ?? ??? ????. ? ?????? ??? ??? ?? ??? ??? ??? ???? ?? ? ????. - ?? : i18N, Translation and GetText? ??? ???? ???? ??? ? ??? ???? ??? ???? ?? ?? ????. ???? ?? ??? ???? ? ??? ??? ???? ??? ??? ? ? ???? ? ??????.
- ?? ??
audero ?? gettext
? ??> ??
< "> ??? ???? ??"audero shared gettext "? ?? ? ??? Composer.json? ?? ?? ?? ? ? ????.
?? ????? GetText Translation? ?? ? ? FAQ (FAQ)
<?php
// 包含翻譯文件的根文件夾的名稱(chēng)
$translationsPath = 'languages';
// 要翻譯到的語(yǔ)言
$language = 'it_IT';
// 翻譯文件的名稱(chēng)(在gettext中稱(chēng)為域)
$domain = 'audero';
// 指示此會(huì)話(huà)將使用哪種語(yǔ)言
putenv("LANG=" . $language);
setlocale(LC_ALL, $language);
// 設(shè)置當(dāng)前域的路徑
bindtextdomain($domain, $translationsPath);
// 指定字符編碼
bind_textdomain_codeset($domain, 'UTF-8');
// 選擇域
textdomain($domain);
// 調(diào)用gettext()函數(shù)(它有一個(gè)名為_(kāi)()的別名)
echo gettext("HELLO_WORLD"); // 等效于echo _("HELLO_WORLD");
?>
/**
* 創(chuàng)建翻譯文件的鏡像副本
*
* @return string 創(chuàng)建的翻譯文件的名稱(chēng)(在gettext中稱(chēng)為域)
*
* @throws \Exception 如果找不到翻譯文件
*/
public function updateTranslation()
{
if (!self::translationExists()) {
throw new \Exception('在給定路徑中找不到翻譯文件。');
}
$originalTranslationPath = $this->getTranslationPath();
$lastAccess = filemtime($originalTranslationPath);
$newTranslationPath = str_replace(self::FILE_EXTENSION, $lastAccess . self::FILE_EXTENSION, $originalTranslationPath);
if(!file_exists($newTranslationPath)) {
copy($originalTranslationPath, $newTranslationPath);
}
return $this->domain . $lastAccess;
}
??
<.> Poedit? ?? ??? ???? .po ? .mo ??? ?? ? ????. ? ??? ???? .po ??? ???? ???? ???? .MO ??? ??? ? ? ????. ??? ???? ???? ???? .po ??? ?? ?? ??? .mo ??? ?????? Poedit ?? MSGFMT? ?? ??? ?????.
? ??? ?? ????? GetText ?? ??? ?? ?????. ??? ??? 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. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

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

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

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled
