1. Go to this page and download the library: Download sevens/vars 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/ */
use Seven\Vars\Strings;
$string = new Strings($alg, $salt, $iv);
$string->encrypt($data);
$string->decrypt($encryptedData);
/**
* Checks if a string ends with a specific string
*
* @param string $value
* @param string|string[] $end
* @param bool $ignoreCase
* @return bool
*/
public static function endsWith(string $value, $end, bool $ignoreCase = false): bool
/**
* Checks if a string starts with a specific string
*
* @param string $value
* @param string|string[] $start
* @param bool $ignoreCase
* @return bool
*/
public static function startsWith(string $value, $start, bool $ignoreCase = false): bool
/**
* Extracts a string from between two strings, the start string and the stop string
* @param string $full
* @param string $start
* @param string $stop
* @param bool $ignoreCase
* @return string
*/
public function between($full, $start, $stop, bool $ignoreCase = true): string
/**
* Checks if a string contains a specific string
*
* @param string $value
* @param string|array $contain
* @param bool $ignoreCase
* @return bool
*/
public static function contains(string $str, $contain, bool $ignoreCase = false): bool
/**
* Checks if a string matches a pattern
*
* @param string $str
* @param string $pattern => regular expression pattern
* @return bool
*/
public static function matchesPattern(string $str, string $pattern): bool
/**
* Returns a very random string over 32 characters in length
* @return string
*/
public static function randToken(): string
/**
* Returns a very random string of fixed length
* @param len
* @return string
*/
public static function fixedLengthToken(int $len): string
/**
* trims string to specified length starting from the specified offset
* It is multibyte
* @param string var
* @param int count
* @return reduced string to the specified length
*/
final public static function limit($var, $count = 2225, $offset = 0)
/**
* Returns a random string with very high entropy due to the specified string;
* It will never return two equal strings
* @param string str
* @return string unique_name
*/
final public static function uniqueId(string $str): string
$validation->rules([
#checks if a value was provided or not
'name' => [ '
#checks for minimum and maximum character length
'password' => [ ' less than 60
'age' => [ 'numeric' => true, 'gt' => 17, 'lt' => '60'],
]);
$validation->passed(): bool;
$validation->errors(): array;
$validation->rules([
])->then(function(){
#This callable is called only when valiidations pass
})->catch(function($errors){
#This callable is called only the validation fails
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.