create_captcha()

create_captcha([$data = ''[, $img_path = ''[, $img_url = ''[, $font_path = '']]]])

Parameters:
  • $data (array) – Array of data for the CAPTCHA
  • $img_path (string) – Path to create the image in
  • $img_url (string) – URL to the CAPTCHA image folder
  • $font_path (string) – Server path to font
Returns:

array(‘word’ => $word, ‘time’ => $now, ‘image’ => $img)

Return type:

array

Takes an array of information to generate the CAPTCHA as input and creates the image to your specifications, returning an array of associative data about the image.

array(
        'image' => IMAGE TAG
        'time'  => TIMESTAMP (in microtime)
        'word'  => CAPTCHA WORD
)

The image is the actual image tag:

<img src="http://example.com/captcha/12345.jpg" width="140" height="50" />

The time is the micro timestamp used as the image name without the file extension. It will be a number like this: 1139612155.3422

The word is the word that appears in the captcha image, which if not supplied to the function, will be a random string.

doc_CodeIgniter
2016-10-15 16:32:12
Comments
Leave a Comment

Please login to continue.