PHP Basics and Syntax Flashcards

1
Q

3 Types of arrays in PHP

A
  1. Numeric/Indexed Arrays
  2. Associative Arrays
  3. Multidimensional Arrays
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

An array with a numeric index. Values are stored and accessed in linear fashion.

A

Numeric/Indexed Array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

An array with Strings as index. This stores element values in association with key values rather than in a strict linear index order.

A

Associative array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

An array containing one or more arrays and values are accessed using multiple indices.

A

Multi-dimensional Array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It is used to reverse a string. It is one of the most basic string operations which are used by programmers and developers.

A

strrev()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

String function that is used to compare two strings from each other.

A

strcmp()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

It is used to find the length of string or returns the length of a string including all the whitespaces and special character.

A

strlen()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

It is used to strip whitespace from the beginning and end of a string or both side of a string.

A

trim()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

It is used to parse the string into variables.

A

parse_str()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A __ is a sequence of characters, denoting the date and/or time at which a certain event occurred.

A

timestamp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

formatting options in date() function

  1. d
  2. D
  3. m
  4. M
  5. y
  6. Y
A
  1. Represents day of the month; two digits with leading zeros
  2. Represents day of the week in the text as an abbreviation
  3. Represents month in numbers with leading zeros (01 or 12).
  4. Represents month in text, abbreviated (Jan to Dec).
  5. Represents year in two digits (08 or 14).
  6. Represents year in four digits (2008 or 2014).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

used to get the current time as a Unix timestamp (the number of seconds since the beginning of the Unix epoch: January 1, 1970, 00:00:00 GMT).

A

time () function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

allow you to include the code contained in a PHP file within another PHP file.

A

include() and require()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The include and require statements are identical, except upon failure:
* ___ will produce a fatal error (E_COMPILE_ERROR) and stop the script
* ___ will only produce a warning\ (E_WARNING) and the script will continue

A
  1. require
  2. include
How well did you know this?
1
Not at all
2
3
4
5
Perfectly