PHP code example of luckystar / validation

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

    

luckystar / validation example snippets


$rules = [
    'username' => 'rules'...
];

//or ..

$rules = [
    'username' => [
        'rules' => '=> 'Username is too long max: :number',
            'min_length' => 'Username is too short min:  :number'
        ]
    ]
];


$checker = $validation->validateRule($_POST, $rules);


idation = new LuckyStar\Validation\Validate;

// Add Rules

$rules = [
	'username' => [
		'rules' => 'max_length[3]|min_length[1]'
	],
	'password' => [
		'rules'  => 'max_length[10]|min_length[5]',
		'error_messages' => [
			'max_length' => 'Password is too long',
			'min_length' => 'Password is too short'
		]
	],
	'number' => [
		'rules' => 'is_numeric|max_length[8]|min_length[3]',
		'error_messages' => [
			'is_numeric' => ' Sayısal olmalı ...',
			'max_length' => 'Number is too long',
			'min_length' => 'Number is too short'
		]
	],
	'req' => [
		'rules' => '