Shared Flashcard Set

Details

Zend PHP certification flashcards
array and string function flashcards
104
Computer Science
Professional
07/20/2013

Additional Computer Science Flashcards

 


 

Cards

Term
addcslashes
Definition
(string $str, string $charlist)

Returns a string with backslashes before characters that are listed in charlist parameter
Term
string addslashes
Definition
(string $str)

Returns a string with backslashes before characters that need to be quoted in database queries.
Term
bin2hex
Definition
(string $str)

Returns an ASCII string containing the hexadecimal representation of str. The conversion is done byte-wise with the high-nibble first.
Term
chop
Definition
function is an alias of rtrim()
Term
chr
Definition
(int $ascii)

Returns a one-character string containing the character specified by ascii.
Term
chunk_split
Definition
(string $body [,int $chunklen = 76[, string $end = "\r\n"]])

Can be used to split a string into smaller chunks which is useful for converting base64_encode() output to match RFC 2045 semantics. It inserts end every chunklen characters
Term
convert_cyr_string
Definition
(string $str, string $from, string $to)

Converts from one Cyrillic character set to another
Term
convert_uudecode
Definition
(string $data)

decods a uuencoded string
Term
convert_uuencode
Definition
(string $data)

encodes a string using the uuencode algorithm.

uuencode translates all strings into printable characters, making them safe for network transmissions.
Term
count_chars
Definition
(string $string[,int $mode = 0])

Counts the number of occurrences of every byte-value in string and returns it in various ways.
Term
crc32
Definition
(string $str)

Generates the cyclic redundancy checksum polynomial of 32-bit lengths of str. This is usually used to validate the integrity of data being transmitted.
Term
crypt
Definition
(string $str[, string $salt])

will return a hashed string using the standard Unix DES-based algorithm or alternative algorithms that may be available on the system.
Term
echo
Definition
(string $arg1[, string $...])

Outputs all parameters
Term
explode
Definition
(string $delimeter, string $string[,int $limit])

Returns an array of strings, each of which is a substring of string formed by splitting on boundries formed by the string delimeter
Term
fprintf
Definition
(resource $handle, string $format[, mixed $args[, mixed $...]])

Write a string produced according to format to the stream resource specified by handle

returns the length of the string written
Term
get_html_translation_table
Definition
([ int $table = HTML_SPECIALCHARS [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' ]]] )

will return the translation table that is used internally for htmlspecialchars() and htmlentities()
Term
hebrev
Definition
(string $hebrew_text[, int $max_chars_per_line = 0])

Converts logical hebrew text to visual text. The function tries to avoid breaking words
Term
hebrevc
Definition
(string $hebrew_text[, int $max_chars_per_line = 0]) similar to hebrev() with the difference that it converts newlines \n to
\n
Term
hex2bin
Definition
(string $data)

Decodes a hexadecimally encoded binary string

Returns false on failure
Term
html_entity_decode
Definition
( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' ]] )

the opposite of htmlentities() in that it converts all HTML entities in the string to their applicable characters
Term
htmlentities
Definition
( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' [, bool $double_encode = true ]]] )

function is identical to htmlspecialchars() in all ways, except all characters which have HTML character entity equivalents are translated into these entities
Term
htmlspecialchars_decode
Definition
( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 ] )

This function is the opposite of htmlspecialchars(). It converts special HTML entities back to characters
Term
htmlspecialchars
Definition
( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' [, bool $double_encode = true ]]] )

Convert special characters to HTML entities
Term
implode
Definition
(string $glue, array $pieces)

join array elements with a glue string
Term
join
Definition
function is an alias of implode()
Term
lcfirst
Definition
(string $str)

Make a string's first character lowercase
Term
levenshtein
Definition
( string $str1 , string $str2 )
( string $str1 , string $str2 , int $cost_ins , int $cost_rep , int $cost_del )

Calculate teh Levenshtein distance between two strings
Term
localeconv
Definition
(void)

returns an associative array containing localized numeric and monetary formatting information
Term
ltrim
Definition
(string $str[, string $charlist])

Strip whitespace or other characters from beginning of the string
Term
md5_file
Definition
( string $filename [, bool $raw_output = false ] )

Caclulates the MD5 hash of the file specified by the filename parameter. The has is a 32 char hex number
Term
join
Definition
function is an alias of implode()
Term
lcfirst
Definition
(string $str)

Make a string's first character lowercase
Term
levenshtein
Definition
( string $str1 , string $str2 )
( string $str1 , string $str2 , int $cost_ins , int $cost_rep , int $cost_del )

Calculate teh Levenshtein distance between two strings
Term
localeconv
Definition
(void)

returns an associative array containing localized numeric and monetary formatting information
Term
ltrim
Definition
(string $str[, string $charlist])

Strip whitespace or other characters from beginning of the string
Term
md5_file
Definition
( string $filename [, bool $raw_output = false ] )

Caclulates the MD5 hash of the file specified by the filename parameter. The has is a 32 char hex number
Term
md5
Definition
( string $str [, bool $raw_output = false ] )

Calculates teh MD5 has of str using MD5 algorithm
Term
metaphone
Definition
( string $str [, int $phonemes = 0 ] )

Calculates the metaphone key of a string
Term
money_format
Definition
( string $format , float $number )

Formats a number as a currency string
Term
nl_langinfo
Definition
(int $item)

is used to access individual elements of the locale catagories
Term
nl2br
Definition
( string $string [, bool $is_xhtml = true ] ) Returns string with '
' or '
' inserted before all newlines (\r\n etc)
Term
number_format
Definition
( float $number [, int $decimals = 0 ] )
( float $number , int $decimals = 0 , string $dec_point = '.' , string $thousands_sep = ',' )

If only one parameter is given, number will be formatted without decimals, but with a comma (",") between every group of thousands.

If two parameters are given, number will be formatted with decimals decimals with a dot (".") in front, and a comma (",") between every group of thousands.

If all four parameters are given, number will be formatted with decimals decimals, dec_point instead of a dot (".") before the decimals and thousands_sep instead of a comma (",") between every group of thousands.
Term
ord
Definition
(string $string)

Returns the ASCII value of character
Term
parse_str
Definition
(string $str[, array &$arr])

Parses str as if it were the query string passed via a URL and sets variables in the current scope
Term
print
Definition
(string $arg)

Output a string
Term
printf
Definition
( string $format [, mixed $args [, mixed $... ]] )

Outputs a formatted string
Term
quoted_printable_decode
Definition
(string $str)

Convert a quoted-printable string to an 8 bit string
Term
quoted_printable_encode
Definition
(string $str)

Convert a 8 bit string to a quoted-printable string
Term
quotemeta
Definition
(string $str)

Returns a version of str with a backslash character (\) before every character that is among these:

. \ + * ? [ ^ ] ( $ )
Term
rtrim
Definition
( string $str [, string $charlist ] )

This function returns a string with whitespace stripped from the end of str.
Term
setlocale
Definition
( int $category , string $locale [, string $... ] )

( int $category , array $locale )

Set locale information
Term
sha1_file
Definition
( string $filename [, bool $raw_output = false ] )

Calculate the sha1 hash of a file
Term
sha1
Definition
( string $str [, bool $raw_output = false ] )

Calculates the sha1 hash of str using the ยป US Secure Hash Algorithm 1
Term
similar_text
Definition
( string $first , string $second [, float &$percent ] )

Calculate the similarity between two strings
Term
soundex
Definition
(string $str)

Calculate the soundex key of a string
Term
sprintf
Definition
( string $format [, mixed $args [, mixed $... ]] )

Returns a string produced according to the formatting string format.
Term
sscanf
Definition
( string $str , string $format [, mixed &$... ] )

Parses input from a string according to a format
Term
str_getcsv
Definition
( string $input [, string $delimiter = ',' [, string $enclosure = '"' [, string $escape = '\\' ]]] )

Parses a string input for fields in CSV format and returns an array containing the fields read.
Term
str_ireplace
Definition
( mixed $search , mixed $replace , mixed $subject [, int &$count ] )

Case-insensitive version of str_replace().
Term
str_pad
Definition
( string $input , int $pad_length [, string $pad_string = " " [, int $pad_type = STR_PAD_RIGHT ]] )

Pad a string to a certain length with another string
Term
str_repeat
Definition
( string $input , int $multiplier )

Repeat a string multiplier times
Term
str_replace
Definition
( mixed $search , mixed $replace , mixed $subject [, int &$count ] )

Replace all occurrences of the search string with the replacement string
Term
str_rot13
Definition
( string $str )

Perform the rot13 transform on a string. Shifts every letter by 13 places.
Term
str_split
Definition
( string $string [, int $split_length = 1 ] )

Converts a string to an array of chars
Term
str_shuffle
Definition
(string $str)

Randomly shuffles a string
Term
str_word_count
Definition
( string $string [, int $format = 0 [, string $charlist ]] )

Return information about words used in a string
Term
strcasecmp
Definition
( string $str1 , string $str2 )

Binary safe case-insensitive string comparison
Term
strchr
Definition
Alias of strstr()
Term
strcmp
Definition
( string $str1 , string $str2 )

Binary safe case sensitive string comparison
Term
strcoll
Definition
( string $str1 , string $str2 )

Locale based string comparison
Term
strcspn
Definition
( string $str1 , string $str2 [, int $start [, int $length ]] )

Returns the length of the initial segment of str1 which does not contain any of the characters in str2.
Term
strip_tags
Definition
( string $str [, string $allowable_tags ] )

This function tries to return a string with all NUL bytes, HTML and PHP tags stripped from a given str. It uses the same tag stripping state machine as the fgetss() function.
Term
stripcslashes
Definition
( string $str )

Returns a string with backslashes stripped off. Recognizes C-like \n, \r ..., octal and hexadecimal representation.
Term
stripos
Definition
( string $haystack , string $needle [, int $offset = 0 ] )

Find the numeric position of the first occurrence of needle in the haystack string. case insensitive
Term
stripslashes
Definition
( string $str )

Un-quotes a quoted string.
Term
stristr
Definition
( string $haystack , mixed $needle [, bool $before_needle = false ] )

Returns all of haystack starting from and including the first occurrence of needle to the end.
Term
strlen
Definition
(string $str)

Returns the length of the given string.
Term
strnatcasecmp
Definition
( string $str1 , string $str2 )

Case insensitive string comparisons using a "natural order" algorithm
Term
strnatcmp
Definition
( string $str1 , string $str2 )

String comparisons using a "natural order" algorithm
Term
strncasecmp
Definition
( string $str1 , string $str2 , int $len )

This function is similar to strcasecmp(), with the difference that you can specify the (upper limit of the) number of characters from each string to be used in the comparison.
Term
strncmp
Definition
( string $str1 , string $str2 , int $len )

This function is similar to strcmp(), with the difference that you can specify the (upper limit of the) number of characters from each string to be used in the comparison.

Note that this comparison is case sensitive.
Term
strpbrk
Definition
( string $haystack , string $char_list )

searches the haystack string for a char_list.
Term
strpos
Definition
( string $haystack , mixed $needle [, int $offset = 0 ] )

Find the position of the first occurrence of a substring in a string
Term
strrchr
Definition
( string $haystack , mixed $needle )

Find the last occurrence of a character in a string
Term
strrev
Definition
( string $string )

Reverse a string
Term
strripos
Definition
( string $haystack , string $needle [, int $offset = 0 ] )

Find the numeric position of the last occurrence of needle in the haystack string.

Unlike the strrpos(), strripos() is case-insensitive.
Term
strrpos
Definition
( string $haystack , string $needle [, int $offset = 0 ] )

Find the numeric position of the last occurrence of needle in the haystack string.
Term
strspn
Definition
( string $subject , string $mask [, int $start [, int $length ]] )

Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask.
Term
strstr
Definition
( string $haystack , mixed $needle [, bool $before_needle = false ] )

Find the first occurrence of a string
Term
strtok
Definition
( string $str , string $token )
( string $token )

splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token. That is, if you have a string like "This is an example string" you could tokenize this string into its individual words by using the space character as the token.
Term
strtolower
Definition
( string $str )

Returns string with all alphabetic characters converted to lowercase.
Term
strtoupper
Definition
( string $string )

Returns string with all alphabetic characters converted to uppercase.
Term
strtr
Definition
( string $str , string $from , string $to )

( string $str , array $replace_pairs )

Translate characters or replace substrings
Term
substr_compare
Definition
( string $main_str , string $str , int $offset [, int $length [, bool $case_insensitivity = false ]] )

Binary safe comparison of two strings from an offset, up to length characters
Term
substr_count
Definition
( string $haystack , string $needle [, int $offset = 0 [, int $length ]] )

Count the number of substring occurrences
Term
substr_replace
Definition
( mixed $string , mixed $replacement , mixed $start [, mixed $length ] )

Replace text within a portion of a string
Term
substr
Definition
( string $string , int $start [, int $length ] )

Return part of a string
Term
trim
Definition
( string $str [, string $charlist = " \t\n\r\0\x0B" ] )

Strip whitespace (or other characters) from the beginning and end of a string
Term
ucfirst
Definition
( string $str )

Make a string's first character uppercase
Term
ucwords
Definition
( string $str )

Uppercase the first character of each word in a string
Term
vfprintf
Definition
( resource $handle , string $format , array $args )

Write a formatted string to a stream
Term
vprintf
Definition
( string $format , array $args )

Output a formatted string
Term
vsprintf
Definition
( string $format , array $args )

Return a formatted string
Term
wordwrap
Definition
( string $str [, int $width = 75 [, string $break = "\n" [, bool $cut = false ]]] )

Wraps a string to a given number of characters
Supporting users have an ad free experience!