-
Notifications
You must be signed in to change notification settings - Fork 6
str
KentonJack edited this page Mar 4, 2018
·
7 revisions
- html - Input a string and tranfomr it to html format
- str::html($your_string)
-
- 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
-
str::html('hello world'); //returns 'hello world'
- utf8 - change the input string to html format and return the new string
- str::utf8($your_html_string)
-
str::utf8('hello world'); //returns 'hello world'
- cut - cut the given string and return the new string containing the first $limit characters
- str::cut($your_string, $your_length)
-
-
str::cut('hello world',7); //returns 'hello w'
-
- lower - Change all strings in input to lower case
- str::lower($your_string_or_your_array)
-
- 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
-
str::lower('Hello WorlD'); //returns 'hello world' str::lower(['H','COM']); //returns ['h','com']
- upper - Change all strings in input to lower case
- str::upper($your_string_or_your_array)
-
- 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
-
str::upper('Hello WorlD'); //returns 'HELLO WORLD' str::upper(['h','com']); //returns ['H','COM']
- random - return a $limit length randomly made string
- str::random($your_length)
-
- Function accepts a given length to make a string and returns a randomly made string
- 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
-
str::random(8); //generates an random str with the length of 8
- unix_dir - Change a windows path to a unix path
- str::unix_dir($your_path)
-
- Function accepts a windows path and returns an equivalent unix path
- Function seeks for specific characters in windows path and replace them with equavalent characters in unix path. Then returns the modified path
-
str::unix_dir('D:\angel_home'); //return 'D:/angel_home'
- windows_dir - Change a unix path to a windows path
- str::windows_dir($your_path)
-
- Function accepts a unix path and returns an equivalent windows path
- Function seeks for specific characters in windows path and replace them with equavalent characters in unix path. Then returns the modified path
-
str::windows_dir('D:/path'); //return 'C:\path'