PHP code example of dearmadman / captcha

1. Go to this page and download the library: Download dearmadman/captcha 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/ */

    

dearmadman / captcha example snippets


    'providers' => array(
        // ...
        'Dearmadman\Captcha\CaptchaServiceProvider',
    )


    // [your site path]/app/routes.php

   Route::get('captcha',function(Captcha $captcha){

    $captcha->InitFromArray([
        'width'=>100,
        'height'=>50,
        'chinese'=>true,
        'char_num'=>5,
        'line_x'=>3,
        'line_y'=>2,
        'pixel'=>300
    ]);
    return $captcha->PushImage();

	});

    Route::get('check',function(Captcha $captcha){

    return $captcha->check('板迷的细财')?'ok':'wrong';
    
	});