PHPackages                             lorddashme/php-simple-captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. lorddashme/php-simple-captcha

ActiveLibrary[Security](/categories/security)

lorddashme/php-simple-captcha
=============================

A simple captcha package that fit to any type of web application built on php.

1.2.0(7y ago)102.9k↓66.7%1MITPHPPHP &gt;=5.6 || &gt;=7.0 || &gt;=7.1 || &gt;=7.2CI failing

Since Sep 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LordDashMe/php-simple-captcha)[ Packagist](https://packagist.org/packages/lorddashme/php-simple-captcha)[ Docs](https://github.com/lorddashme/php-simple-captcha)[ RSS](/packages/lorddashme-php-simple-captcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

PHP Simple Captcha
==================

[](#php-simple-captcha)

A simple captcha package that fit to any type of web application built on php.

[![Latest Stable Version](https://camo.githubusercontent.com/f0f666aaa02e6e33efb5f8a1944eae454999edc1f642b618ed95bb70a43170f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f7264646173686d652f7068702d73696d706c652d636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lorddashme/php-simple-captcha) [![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![Coverage Status](https://camo.githubusercontent.com/3c5bfd78a42073ba707a993dfe4b85e4655d7341aa5b21f97e9fe468d3c01b69/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4c6f7264446173684d652f7068702d73696d706c652d636170746368612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/LordDashMe/php-simple-captcha?branch=master)

Sample
------

[](#sample)

[![PHP Simple Captcha Sample 1](resources/img/sample1.png)](resources/img/sample1.png) [![PHP Simple Captcha Sample 2](resources/img/sample2.png)](resources/img/sample2.png) [![PHP Simple Captcha Sample 3](resources/img/sample3.png)](resources/img/sample3.png) [![PHP Simple Captcha Sample 4](resources/img/sample4.png)](resources/img/sample4.png)

Requirement(s)
--------------

[](#requirements)

- PHP version from 5.6.\* up to latest.

Install
-------

[](#install)

- Recommended to install using Composer. Use the command below to install the package:

```
composer require lorddashme/php-simple-captcha
```

Usage
-----

[](#usage)

### List of Available Functions

[](#list-of-available-functions)

FunctionDescription`code(length);`Execute the generation of random code base on the given length.
 The default length is 5.`image();`Execute the generation of image and the content will be base on the `code(length);` function.`getCode();`To get the current code generated by the `code(length);` method.
 Ex. return value `QwErTyx...``getImage();`To get the current image generated by the `image();` function.
 Ex. return value `data:image/png;base64,iVBORw0KGgoAA...``storeSession();`Use to store the generated values in the captcha session.`getSession();`Use to get the current stored session generated values in the captcha session. This is use to validate the generated code against the user organic inputed code.
 Ex. return value `array('code' => '...')`- Basic usage:

```

          ...
