PHP? ??? ??? ? ??? ??? ?????.
Jun 23, 2023 am 09:31 AMPHP? ????? ???? ??? ????? ??? ? ??? ?? ???? ?? ?????. ? ? ??? ??? ? ???? ???? ???? ????? ???? ?? ? ?????. ??? PHP? ???? ??? ??? ? ??? ??? ???? ??? ?????.
1. ??? ??? ??
?? ??? ??? ?? ??? ?????. ?? ??? ??? ??? ??? ??? ?????.
<html> <head> <meta charset="UTF-8"> <title>圖片上傳</title> </head> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="submit" value="上傳"> </form> </body> </html>
? ???? ??? ??? ??? ?? ??? upload.php?? ?? ????? ?????. ???? ??? ?????? ?? ??? enctype ??? "multipart/form-data"? ???? ???. ???? ??? ??? ???? ??? ?? ??? ? ????.
??? upload.php ?? ???????.
<?php // 指定文件上傳的目錄 $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["file"]["name"]); // 獲取文件類型 $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // 檢查文件是否是圖片 if(isset($_POST["submit"])) { $check = getimagesize($_FILES["file"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } // 如果文件已經(jīng)存在,提示并退出 if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // 檢查文件大小 if ($_FILES["file"]["size"] > 500000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // 允許上傳的圖片類型 if($imageFileType != "jpg" && $imageFileType != "jpeg" && $imageFileType != "png" && $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } // 如果沒有錯(cuò)誤,進(jìn)行文件上傳 if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; } else { if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["file"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } ?>
? ????? ???? ?? ?? ?? ??? ?? ??? ?? ?? ? ?? ??? ?? ??? ?????. ?? ??? ??? ??? ???? ??? ?????, ??? ??? ?? ???? ?????.
2. ??? ??? ??
??? ??? ??? ???? ???? ? ??? ??, ?? ?? ?? ??? ?? ??? ?? ????. ??? PHP? ???? ??? ??? ??? ???? ??? ?????. ? ????? PHP ?????-GD ?????? ???? ???? ?????.
- GD ????? ??
GD ?????? ???? ?? ?????? ???? ??? ???? ??, ??? ??? ???? ???. Linux ?????? ?? ??? ?? GD ?????? ??? ? ????.
sudo apt-get install php7.2-gd
Windows ???? ?? php ?? ?? php.ini?? ?? ???? ????.
;extension=php_gd2.dll
???? ?????.
extension=php_gd2.dll
???? ?? ?????. php.
- ?? ???
GD ?????? ???? ?? ??? ????? ???? ???. Imagecreatefromjpeg(), Imagecreatefrompng(), Imagecreatefromgif()? ?? ??? ???? ??? ??? ???? ??? ? ????. ??? ??? ??? ???????.
//載入原圖 $src = imagecreatefromjpeg('test.jpg'); //裁剪原圖 $dst = imagecreatetruecolor(100, 100); imagecopyresampled($dst, $src, 0, 0, 50, 50, 100, 100, 100, 100); //保存裁剪后的圖片 imagejpeg($dst, 'test_crop.jpg'); //釋放原圖和裁剪后的圖片 imagedestroy($src); imagedestroy($dst);
? ????? ??? ?? ?? imagecreatetruecolor()? ???? ?? ???? ??? ?? imagecopyresampled() ??? ???? ?? ???? ?? ???? ??? ?????. ????? imagejpeg() ??? ???? ?? ???? ?????.
3. ??
PHP??? ??? ??? GD ?????? ???? ???? ?? ????? ?? ? ????. ? ??? ???? ??? ?? ??????? ?????. ??? ??? ? ???? ?? ??? ??? ?? ???? ??? ?? ??? ????? ??? ? ?? ??? ? ????.
? ??? 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)

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PhpisstillRelevantinmodernenterpriseenvironments.1. Modernphp (7.xand8.x)? ??? ??, ??? ??, jitcompilation ? modernsyntax, mateitsuilableforlarge-scalepplications

??? AI ?? ?? ???? ???? PHPSDK? ??????. 2. PHP? ???? FFMPEG? ???? ???? API ?? ?? (? : WAV)?? ?????. 3. ??? ???? ????? ????? API ???? ??? ??????. 4. NLP ??? ???? JSON ??? ???? ???? ?????. 5. ?? ??? ???? ???? ?? ?? ?? ?? ?? ??? ?????. ?? ????? ?? ?? ? ??? ???? ?? ??? ???, ??? ?? ? ??? ???????.
