STRING MANIPULATION

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/56

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:03 AM on 6/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

57 Terms

1
New cards

text string

A _____ contains zero or more characters surrounded by double or single quotation marks

2
New cards

single

To include a quoted string within a literal string surrounded by double quotation marks, you surround the quoted string with _____ quotation marks

3
New cards

double

To include a quoted string within a literal string surrounded by single quotation marks, you surround the quoted string with ____ quotation marks

4
New cards

Concatenation operator (.)

_______ combines two strings and assigns the new value to a variable

5
New cards

escape character, backslash (\)

An _____ tells the compiler or interpreter that the character that follows it has a special purpose. In PHP, the _______ is the _______

6
New cards

Simple string syntax

______ uses the value of a variable within a string by including the variable name inside a text string with double quotation marks

7
New cards

complex string syntax

When variables are placed within curly braces inside of a string, it is called ______

8
New cards

strlen(), one

The most commonly used string counting function is the _____ function, which returns the total number of characters in a string. Escape sequences, such as \n, are counted as ____ character

9
New cards

str_word_count()

The______ function returns the number of words in a string

10
New cards

strtoupper()

The ______ function converts all letters in a string to uppercase

11
New cards

strtolower()

The ______ function converts all letters in a string to lowercase

12
New cards

ucfirst()

The _____ function ensures that the first character of a word is uppercase

13
New cards

lcfirst()

The ______ function ensures that the first character of a word is lowercase

14
New cards

ucwords()

The ______ function changes the first character of each word

15
New cards

htmlspecialchars()

The ______ function converts special characters to HTML entities

16
New cards

htmlspecialchars_decode()

The ______ function converts HTML character entities into their equivalent characters

17
New cards
  • &

  • &quot

  • '

  • <

  • >

  • '&' (ampersand) becomes '____'

  • '"' (double quote) becomes '____' when ENT_NOQUOTES is disabled.

  • ''' (single quote) becomes '____' only when ENT_QUOTES is enabled.

  • '<' (less than) becomes '____'

  • '>' (greater than) becomes '____'

18
New cards

ENT_QUOTES

If _____ is disabled in the PHP configuration, neither single nor double quotes are converted

19
New cards

md5(), Message- Digest Algorithm

The _____ function uses a strong encryption algorithm (called the ________) to create a one-way hash

20
New cards

one-way hash

A ______ is a fixed-length string based on the entered text, from which it is nearly impossible to determine the original text

21
New cards

md5()

The _____ function does not have an equivalent decode function, which makes it a useful function for storing passwords in a database

22
New cards

SHA-256, National Institute of Standards and Technology (NIST)

The second version of SHA, called SHA-2, has many variants. Probably the one most commonly used is ____, which the ________ recommends using instead of MD5 or SHA-1

23
New cards

256, 64

The SHA-256 algorithm returns hash value of ___-bits, or ___ hexadecimal digits. While not quite perfect, current research indicates it is considerably more secure than either MD5 or SHA-1

24
New cards

urlencode()

this function takes a string and encodes it (changes its format) so that it can properly be passed as part of a URL

25
New cards
  • trim()

  • ltrim()

  • rtrim()

  • The ____ function will strip (remove) leading or trailing spaces in a string

  • The ____ function removes only the leading spaces

  • The ____ function removes only the trailing spaces

26
New cards

substr()

The _____ function returns part of a string based on the values of the start and length parameters

27
New cards

positive, start, negative

A _____ number in the ____ parameter indicates how many character to skip at the beginning of the string. A _____ number in the _____ parameter indicates how many characters to count in from the end of the string

28
New cards

positive, length, negative

A ____ value in the in the ____ parameter determines how many characters to return. A ____ value in the ____ parameter skip that many characters at the end of the string and returns the middle portion

29
New cards

entire remainder

If the length is omitted or is greater than the remaining length of the string, the ______ of the string is returned

30
New cards

Parsing

_____ is the act of dividing a string into logical component substrings or tokens

31
New cards

parsing

When programming, _____ refers to the extraction of information from string literals and variables

32
New cards

strpos()

The _____ function performs a case- sensitive search and returns the position of the first occurrence of one string in another string

33
New cards

FALSE

If the search string is not found, the strpos() function returns a Boolean value of _____

34
New cards

strict equal operator(===), strict not equal operator (!==)

To determine whether the strpos() function (and other string functions) actually returns a Boolean FALSE value and not a 0 representing the first character in a string, you must use the ______ or the ________

35
New cards

strchr(), strrchr()

Both functions return a substring from the specified characters to the end of the string

36
New cards

strchr(), strrchr()

_____ function starts searching at the beginning of a string ____ function starts searching at the end of a string

37
New cards

str_replace(), str_ireplace()

The ______ and ______ functions both accept three arguments:

  • The string you want to search for

  • A replacement string

  • The string in which you want to replace characters

38
New cards

strtok(), tokens

Use the ____ function to break a string into smaller strings, called _____

39
New cards

empty string, separators

The strtok() function returns the entire string if:

  • An _____ is specified as the second argument of the strtok() function.

  • The string does not contain any of the _____ specified

40
New cards

str_split(), explode()

The _____ and _____ functions split a string into an indexed array

41
New cards

str_split(), length

The _____ function splits each character in a string into an array element. The ____ argument represents the number of characters you want assigned to each array element

42
New cards

explode()

The _____ function splits a string into an indexed array at a specified separator

43
New cards

strtok(), first

The order of the arguments for the explode() function is the reverse of the arguments for the ____ function. If the string does not contain the specified separators, the entire string is assigned to the ____ element of the array

44
New cards

FALSE

If you pass to the explode()function an empty string as the separator argument, the function returns a Boolean value of _____

45
New cards

implode()

The _____ function combines an array’s elements into a single string, separated by specified characters

46
New cards

Comparison operators

______ compare individual characters by their position in the American Standard Code for Information Interchange (ASCII), which are numeric representations of English characters

47
New cards

0 to 255

American Standard Code for Information Interchange (ASCII) values range from _____

48
New cards

97, 122

Lowercase letters are represented by the values ___ (“a”) to ___ (“z”)

49
New cards

65, 90

Uppercase letters are represented by the values ___ (“A”) to ___ (“Z”)

50
New cards

strcasecmp(), strcmp()

The _____ function performs a case- insensitive comparison of strings. The ____ function performs a case- sensitive comparison of strings

51
New cards

strncmp(), strncasecmp()

The _____ and ______ functions are very similar to the strcmp() and strcasecmp() functions, except that you need to pass a third integer argument representing the number of characters you want to compare in the strings

52
New cards

similar_text(), levenshtein()

The _____ and _____ functions are used to determine the similarity between two strings

53
New cards

similar_text()

The _____ function returns the number of characters that two strings have in common

54
New cards

levenshtein()

The _____ function returns the number of characters you need to change for two strings to be the same

55
New cards

soundex(), metaphone()

The _____ and _____ functions determine whether two strings are pronounced similarly

56
New cards

soundex()

The _____ function returns a value representing a name’s phonetic equivalent

57
New cards

metaphone()

The _____ function returns a code representing an English word’s approximate sound