Functions & PHP Flashcards

1
Q

PHP meaning

A

Hypertext Preprocessor

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

PHP type of programming language

A
  • open-source
  • interpreted language
  • general-purpose scripting language
  • widely used in webdev
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a php file?

A

can contain text, html tags, and scripts
- returned to the browser as plain html

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

php syntax

A

<?php
?>

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

outputting in php

A

echo
print

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

echo vs print

A

echo has no return value but can take multiple parameters
print has a return value of 1 making it usable for expressions

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

where does the php interpreter execute code?

A

server

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

declaring variables in php

A
  • starts with $ symbol
  • must START w/ letter or underscore(_)
  • can only contain alpha-numeric characters and underscores
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

concatenating operator in php

A

dot (.)
( . ) ( . )
“hello”. “ “ .”world”;

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

function that returns length of string

A

strlen()

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

function that finds the position of the first occurrence of a string inside another string

A

strpos()

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

creating a newline in php

A

“<br></br>”
“\n”

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

getting date in php

A

d - Represents the day of the month (01 to 31)
m - Represents a month (01 to 12)
Y - Represents a year (in four digits)
l (lowercase ‘L’) - Represents the day of the week

echo “Today is “ . date(“Y/m/d”)

Output:
Today is 2020/11/03

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

parameters that are transferred to the function when it is requested.

A

actual parameter

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

a parameter that you specify when you determine the subroutine or function.

A

formal parameter or dummy parameter

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

using POST or GET

A

$_POST[“variable”];
$_GET[“variable”];

16
Q

purpose of action in a form

A

specifies where to send the form-data when a form is submitted.