how are you? hopefully fine. due to the following post I will discuss about the functions of a string in PHP. functions in PHPfunctions I will post it here. following functions are string functions that are often used.
string functions are the functions used to manipulate a string for a particular purpose. The following is a PHPstring functions.
- Addslash
- Used to add a backslash character (\) on a string.It aims to use the query string to the database. examples of characters that need to be backslash (\) is the single quotes ('), two quotation marks ("), marks a backslash (\), and the null character.
- sintax : addslash(string)
- Stripslash
- Used to remove the backslash character (\) on a string.
- sintax : stripslash(string)
- Crypt
- Used to encrypt the DES method of a string. use of the crypt function can be added to a string parameter 'salt'. was added to determine the basis of randomization. If the 'salt' string is not added to the PHP crypt function will determine its own 'salt' is a random string.
- sintax : crypt(string [, salt])
- Echo
- Used to print the contents of a string or argument.
- sintax : echo string
- Explode
- Used to break up a string based on a specific list separator and put the result into a variable array
- sintax : explode (separator string, string [, integer limit])
- Implode
- used to generate a string from each of the elements of an array. The resulting string is separated by a string has been determined previously.
- sintax : implode (separator string, array)
- StripTags
- Used to remove the code in a string of HTML tags.
- sintax : striptags (string [,string exceptions])
- StrLen
- Used to calculate the number of characters of a string.
- sintax : strlen (string)
- StrPos
- Used to find the first position of a sub string in a string. This function is typically used to search a sub string within a string.
- sintax : strpos(string, sub string)
- Str_Repeat
- Used to repeat the content of a string.
- sintax : str_repeat(string , number of repetitions)
- StrToLower
- Used to convert a string to lowercase
- sintax : strtolower(string)
- StrToUpper
- Used to convert a string to uppercase
- sintax : strtoupper(string)
- SubStr
- Used to retrieve a sub-string with a certain length of a string at a particular position as well.
- sintax : substr(string , integer start position, integer end position)
- SubStr_Count
- Used to calculate the number of substring in a string.
- sintax : substr_count(string , string substring)
- UCFirst
- Used to replace the first character in a string to uppercase.
- sintax : ucfirst(string)
- UCWord
- Used to replace the first character of each word in a string to uppercase.
- sintax : ucword(string)
need to know!
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and/or the length changed, or it may be fixed (after creation). A string is generally understood as a data type and is often implemented as a byte (or word) array that stores a sequence of elements, typically characters, using some character encoding. A string may also denote more general array data types and/or other sequential data types and structures; terms such as byte string, or more general, string of datatype, or datatype-string, are sometimes used to denote strings in which the stored data does not (necessarily) represent text.
Depending on programming language and/or precise datatype used, a variable declared to be a string may either cause storage in memory to be statically allocated for a predetermined max length or employ dynamic allocation to allow it to hold chronologically variable number of elements. When a string appears literally in source code, it is known as a string literal and has a representation that denotes it as such.
In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and/or the length changed, or it may be fixed (after creation). A string is generally understood as a data type and is often implemented as a byte (or word) array that stores a sequence of elements, typically characters, using some character encoding. A string may also denote more general array data types and/or other sequential data types and structures; terms such as byte string, or more general, string of datatype, or datatype-string, are sometimes used to denote strings in which the stored data does not (necessarily) represent text.
Depending on programming language and/or precise datatype used, a variable declared to be a string may either cause storage in memory to be statically allocated for a predetermined max length or employ dynamic allocation to allow it to hold chronologically variable number of elements. When a string appears literally in source code, it is known as a string literal and has a representation that denotes it as such.
1 comments:
Good info, useful for me.
Btw I already follow you on number # 36; please follow me too, Guys. Thanks
Post a Comment