PHP code example of selahattinunlu / php-validator
1. Go to this page and download the library: Download selahattinunlu/php-validator 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/ */
selahattinunlu / php-validator example snippets
$validator = new \phpValidator\Validator();
$validator->set($input, array(
'username' => '> 'rmedin!',
'username.min' => 'Kullanıcı adı minimum 5 karakterden oluşmalıdır.',
'username.max' => 'Kullanıcı adı maximum 10 karakterden oluşmalıdır.',
'email.
if ($validator->fails())
return 'hata var!';
else
return 'hata yok!';