CCS0043 Module 5

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

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:50 AM on 7/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

70 Terms

1
New cards

• $_SERVER

• $_GET

• $_POST

• $_REQUEST

• $_COOKIE

• $_SESSION

• $_ENV

Superglobal Variables

2
New cards

An array containing information such as headers, paths, and script locations

$_SERVER

3
New cards

entries were created by the web server

$_SERVER

4
New cards

Index 'PHP_SELF' contains the filename of the currently executing script

$_SERVER

5
New cards

Index '__' contains the filename of the currently executing script

PHP_SELF

6
New cards

An associative array variables passed to the current script via the URL parameters

$_GET

7
New cards

An associative array of variables passed to the current script via the HTTP POST method

$_POST

8
New cards

An associative array that by default contains the contents of $_GET, $_POST, and $_COOKIE

$_REQUEST

9
New cards

An associative array of variables passed to the current script via HTTP Cookies

$_COOKIE

10
New cards

An associative array containing session variables available to the script

$_SESSION

11
New cards

An associative array of variables passed to the current script via the environment method

$_ENV

12
New cards

Mechanism for storing data in the remote browser and thus tracking or identifying return users

Cookies

13
New cards

Small amount of information containing variable=value pair (user's computer)

Cookies

14
New cards

Users can refuse to accepts __

cookies

15
New cards

Managing cookies can be done using __ function

setcookie()

16
New cards

bool setcookie ( string $name [, string $value [, int

$expire = 0 [, string $path [, string $domain [, bool

$secure = false [, bool $httponly = false ]]]]]] )

syntax: setcookie()

17
New cards

Mechanism for storing data on the server itself

Session

18
New cards

The time that a user spends at your Web site

Session

19
New cards

More secure than cookies and can store much more information

Session

20
New cards

To open a session, use __ function

session_start()

21
New cards

Always set at the beginning of each Web page

session_start()

22
New cards

To close the session, use __ function

session_destroy()

23
New cards

Gets rid of all the session variable information that's stored in the session file

session_destroy()

24
New cards

The statement does not affect the variables set on the current page

session_destroy()

25
New cards

To unset session variables, use __ function

unset()

26
New cards

unset($_SESSION['varname']);

syntax: unset

27
New cards

Were used to efficiently search for patterns in a given text

Regular Expression

28
New cards

Also known as regex or regexp

Regular Expression

29
New cards

PHP implements __ __ __ __ (PCRE)

Percl Compatible Regular Expression

30
New cards

PCRE function starts with __

preg_

31
New cards

Performs a regular expression match

preg_match() function

32
New cards

int preg_match ( string $pattern , string

$subject [, array &$matches [, int $flags = 0 [, int

$offset = 0 ]]] )

syntax: preg_match()

33
New cards

Marks the start of a string

^

34
New cards

Marks the end of a string

$

35
New cards

Matches any single character

.

36
New cards

Boolean OR

|

37
New cards

Group elements

()

38
New cards

Item range (a, b or c)

[abc]

39
New cards

Not in range (every character except a, b, or c)

[^abc]

40
New cards

white-space character

\s

41
New cards

Zero or one 'a' character. Equals to a{0,1}

a?

42
New cards

Zero or more of 'a'

a*

43
New cards

One or more of 'a'

a+

44
New cards

Exactly two of 'a'

a{2}

45
New cards

Up to five of 'a'

a{,5}

46
New cards

Between five to ten of 'a'

a{5,10}

47
New cards

Any alpha numeric character plus underscore. Equals to [A-Za-z0-9_]

\w

48
New cards

Any non alpha numeric characters

\W

49
New cards

Any white-space character

\s

50
New cards

Any non white-space character

\S

51
New cards

Any digits. Equal to [0-9]

\d

52
New cards

Any non-digits. Equal to [^0-9]

\D

53
New cards

Ignore case

i

54
New cards

Multiline Mode

m

55
New cards

Extra analysis of pattern

S

56
New cards

Pattern is treated as UTF-8

u

57
New cards

It will match the word hello

'/hello/'

58
New cards

It will match hello at the start of a string. Possible matches are hello or helloworld, but not worldhello

'/^hello/'

59
New cards

It will match hello at the end of a string

'/hello$/'

60
New cards

It will match any character between he and o. Possible matches are heloor heyo, but not hello

'/he.o/'

61
New cards

It will match either llo or hello

'/he?llo/'

62
New cards

It will match hello one or more time. E.g. hello or hellohello

'/hello+/'

63
New cards

Matches llo, hello or hehello, but not hellooo

'/he*llo/'

64
New cards

It will either match the word hello or world

'/hello|world/'

65
New cards

Using it with the hyphen character, this pattern will match every uppercase character from A to Z. E.g. A, B, C...

'/(A-Z)/'

66
New cards

It will match any single character a, b or c

'/[abc]/'

67
New cards

Matches precisely one c character after the characters ab. E.g. matches abc, but not abcc

'/abc{1}/'

68
New cards

Matches one or more c character after the characters ab. E.g. matches abcor abcc

'/abc{1,}/'

69
New cards

Matches between two and four c character after the characters ab. E.g. matches abcc, abccc or abcccc, but not abc

'/abc{2,4}/'

70
New cards

<?php

function validate_email($email_address)

{

if( !preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+

([a-zA-Z0-9\._-]+)+$/", $email_address))

{

return false;

}

return true;

}

?>

Email Validation