Information Computer

Sunday, August 14, 2011

PHP String Fungtions

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.

  1. 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)
  2. Stripslash
    • Used to remove the backslash character (\) on a string.
    • sintax : stripslash(string)
  3. 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])
  4. Echo
    • Used to print the contents of a string or argument.
    • sintax : echo string
  5. 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])
  6. 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)
  7. StripTags
    • Used to remove the code in a string of HTML tags.
    • sintax : striptags (string [,string exceptions])
  8. StrLen
    • Used to calculate the number of characters of a string.
    • sintax : strlen (string)
  9. 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)
  10. Str_Repeat
    • Used to repeat the content of a string.
    • sintax : str_repeat(string , number of repetitions)
  11. StrToLower
    • Used to convert a string to lowercase
    • sintax : strtolower(string)
  12. StrToUpper
    • Used to convert a string to uppercase
    • sintax : strtoupper(string)
  13. 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)
  14. SubStr_Count
    • Used to calculate the number of substring in a string.
    • sintax : substr_count(string , string substring)
  15. UCFirst
    • Used to replace the first character in a string to uppercase.
    • sintax : ucfirst(string)
  16. UCWord
    • Used to replace the first character of each word in a string to uppercase.
    • sintax : ucword(string)
thank :)

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.

Related Posts



1 comments:

CahNdeso said...

Good info, useful for me.
Btw I already follow you on number # 36; please follow me too, Guys. Thanks

Followers