PHP code example of fangxu / safety-inspection
1. Go to this page and download the library: Download fangxu/safety-inspection library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fangxu / safety-inspection example snippets
Route::get("/inspection", function (Fangxu\SafetyInspection\SafetyInspection $inspection) {
$inspection->text("新年快乐", function ($result) {
if ($result->suggestion != "pass") {
throw new \Exception("内容中含有不合法的字段", "405");
}
});
});