-
Notifications
You must be signed in to change notification settings - Fork 6
Data Structure
Open file ary.php in folder ./ary
- ary::map(your_array, your_method)
ary::map($input_array, function($key,$value){
return $value*3;
}); //returns an array with every item multiplied by 3Summary: Function accepts an array& a method and returns an array containing mapped values.
Description: Function put all keys and original values into the given method and sets the return values of the method as new values for the given array then returns the new array.
Note: Function will output an error if the user does not give a valid method.
Open file ary.php in folder ./build
- ary::filter(your_array, your_method)
ary::filter(input_array, function($key,$value){
return $value>3;
}); //returns an array with only items larger than 3Summary: Function accepts an array and a method then return an array
Description: Function inputs all keys and values from the given array into the given method then puts all the elements make the method return true into a new array.
Note: Function will output an error if the given method is invalid.
Open ary.php in folder ./ary
- ary::map(your_array, your_method)
ary::merge([1,2,3],[4,5,6]);
//returns [1,2,3,4,5,6]Open ary.php in folder ./ary
- ary::size(your_array)
ary::size([1,2,3]);
//returns 3Open ary.php in folder ./ary
- ary::last(your_array)
ary::last([1=>1,2=>2,3=>3]);
//returns 3Open ary.php in folder ./ary
- ary::flat(your_array)
ary::flat([[1,2,3],[4,5,[6,7,8]]]);
//returns [1,2,3,4,5,6,7,8]Summary: Accepts an array and returns an array.
Description: Put all the values in the given array and the values in the subarrays together into one array. Then the function returns the new array. Subarrays will not exists in the returned array.
open file is.php in folder ./is
- is::mobile()
is::mobile()
//true if user is using a phoneDescription: Function transform the user's agent string into lower letters then check if it contains 'mobile', 'android', or 'phone' to determine what agent the user is using.
open is.php in folder ./is
- is::empty(your_array_file_or_str)
is::empty($array_file_or_str)
//true if []/['','']/''/0 or $_FILES['a_file'] does not existsSummary: Function accepts an array or a string and returns a boolean.
Description: If the user inputs an array, function will check if $_FILES is empty, if array as whole is empty, and if any array item is empty. If the user inputs a string, function will check if the string is an empty string.
Note: Function returns false if $in_p is not an array or a string.
Open is.php in folder ./is
- is::ary(your_array)
is::ary($array);
//true if $array is an arrayOpen is.php in folder ./is
is::str($str);
//true if $str is a stringOpen is.php in folder ./is
is::int($int);
//true if $int is an integerOpen is.php in folder ./is
is::float($float);
//true if $float is a floatopens is.php in folder ./is
is::regex($input);
//true if $input is a regular expressionSummary: Function returns true if the input matches a regular expression and returns false if the input does not match a regular expression
open file is.php in folder ./is
- is::in(your_part,your_full)
is::in($part,$full);
//true if $part is a part of $fullSummary: Function accepts two parameters and returns true if the first parameter is a part of the second parameter.
Description: If $full is an array, function will loops over $full and check if $part is a part of a value in the array. If $full is not an array and $part is a regular expression, function will check if $part and $full perform a regular expresssion match. If $full is not an array and $part is not a regular expression, function will assume they are strings and check if $part is a substring of $full.
open file is.php in folder ./is
is::url(string $url)
//true if any url is contained in $urlis::dir(string $url) check if the input string has an directory and return the directory if there are any.
open file is.php in folder ./is
is::dir(string $dir)
//true if any directory is contained in $diris::email(string $email) check if the input string has an email and return the email if there are any.
open file is.php in folder ./is
is::email(string $email)
//true if an email address is contained in $emailopen file str.php in folder ./str
- str::html(your_string)
str::html('hello world'); //returns 'hello world'Description: Function will check specific characters and change them to html characters to change the strng to html format. Then the function will return the html format string.
open file str.php in folder ./str
- str::utf8(your_html_string)
str::utf8('hello world'); //returns 'hello world'str::cut(string $in_p, $limit) cut the given string and return the new string containing the first $limit characters
open file str.php in folder ./str
- str::cut(your_string,your_length)
str::cut('hello world',7); //returns 'hello w'open file str.php in folder ./str
- str::lower(your_string_or_your_array)
str::lower('Hello WorlD'); //returns 'hello world'
str::lower(['H','COM']); //returns ['h','com']Summary: Function accepts a string and returns that string in lower case or accepts an array of strings and returns that array of strings in lower case.
open file str.php in folder ./str
- str::upper(your_string_or_your_array)
str::upper('Hello WorlD'); //returns 'HELLO WORLD'
str::lower(['h','com']); //returns ['H','COM']Summary: Function accepts a string and returns that string in upper letters or accepts an array of strings and returns that array of strings in lower letters.
open file str.php in folder ./str
- str::random(your_length)
str::random(8); //generates an random str with the length of 8 Summary: Function accepts a given length to make a string and returns a randomly made string.
Description: Function will randomly choose $limit numbers(The default value of limit is 10) from capital letters A-Z and lower case a-z. Then function returns string that has a length of $limit.
open file str.php in folder ./str
- str::unix_dir(your_path)
str::unix_dir('D:\angel_home');
//return 'D:/angel_home'Summary: Function accepts a unix path and returns an equavalent windows path.
Description: Function seeks for specific characters in unix path and replace them with equavalent characters in windows path. Then returns the modified path.