Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 16 ____is the shortcut operator for concatenation. .= (dot equal) += (p

ID: 3594376 • Letter: Q

Question

QUESTION 16

____is the shortcut operator for concatenation.

.= (dot equal)

+= (plus equal)

QUESTION 17

is the escape sequence for a tab.

True

False

QUESTION 18

Which of the following are true of strpos($str1, $item)? More than one answer is correct.

it finds the position of the first occurrence of $str1 in the $item string and returns the position of where where the $str1 is found.

it finds the position of the first occurrence of the $item string in $str1 and returns the position of where where the $item is found.

it finds the position of the first occurrence of $str1 in the $item string and returns the position of where where the $str1 is found.

the default starting position is positions

QUESTION 19

A variable's scope can be either _____ or ____. Choose 2 answers.

universal

Global

local

intrinsic

QUESTION 20

"What does this code output?

$x = array("tic", "tac", "toe");
echo implode(", ", $x);

"tic, tac, toe"

"tictactoe"

"tic tac toe"

nothing

"tic,tac,toe"

QUESTION 21

What does the variable $y hold?

$x = "person5@xyz.com";
$m = "zyx.org";
$y = substr_replace($x, $m, 8);

person5@zyx.com

person5@xyz.comzyx.org

person5zyx.org

person5@zyx.org

QUESTION 22

A return statement returns a value to the statement that called the function.

True

False

QUESTION 23

"If you use a local variable outside the function in which it is declared, ____."

you'll get an error

it will always have the value NULL

you'll get a warning

it is the same as using a global variable

QUESTION 24

The lines of code that make up a function itself are called the function definition.

True

False

QUESTION 25

What does the variable $y hold after this code runs?

$x = "person5@xyz.com";
$m = "org";
$y = substr_replace($x, $m, 12);

person5@xyz.org

person5@org

person5@xyz..org

person5@xyorg

QUESTION 26

The ____ function returns number of characters in a string.

length()

strlen()

len()

None of the other answer are correct

QUESTION 27

What does the variable $y hold?

$x = "Betelgeuse not Beetlejuice";
$y = substr_count($x, "et");

0

2

3

1

-1

.= (dot equal)

+= (plus equal)

Explanation / Answer

ques 16:- ______ is the shortcut operator for concatenation.
answer:- +=
Example sum += a equais to sum = sum+a;

ques 17:- is the escape sequence for a tab.-
answer:- "True"

ques 18:- Which of the following are true of strpos($str1, $item)?
answer:- option 2:- it finds the position of the first occurrence of the $item string in $str1 and returns the position of where the $item is found.

ques 19:- A variable's scope can be either _____ or ____. Choose 2 answers.:-
answere option 2 and option 3:- "Global or Local".
Global variable are those variable whose scope is lie within entire program/code. The variable define in main are global variable.
local variable are those variable whose scope lies within the function they define beyond that function they are treated as undefine variable.

ques 20:- "What does this code output?
$x = array("tic", "tac", "toe");
echo implode(", ", $x);
answer:- option 4:- Nothing.
The correct output is:- tic,tac,toe without any double quotes
  

ques 21 :- What does the variable $y hold?
$x = "person5@xyz.com";
$m = "zyx.org";
$y = substr_replace($x, $m, 8);
answer:- option 4:- person5@zyx.org
substr_replace($x, $m, 8); mean replace string $x by $m after its 8th character

ques 22:- A return statement returns a value to the statement that called the function.
answer:- "True"

ques 23:- "If you use a local variable outside the function in which it is declared, ____.
answer:- option 1:- "you'll get an error" the scope of
local variable is within the function it is define outside that function they are treat as undefine varible  
  
ques 24:- The lines of code that make up a function itself are called the function definition.
answer:- False
The lines of code that make up a function itself are called the function declaration.
Example "void print(int a);" this is function declaration function defination is one where function is define.
  
ques 25:- What does the variable $y hold after this code runs?
$x = "person5@xyz.com";
$m = "org";
$y = substr_replace($x, $m, 12);
answer:- option 1:- person5@xyz.org
substr_replace($x, $m, 12); mean replace string $x by $m after its 12th character

ques 26 :-The ____ function returns number of characters in a string.:-
answer:- option 2:- "strlen"

ques 27:- What does the variable $y hold?
$x = "Betelgeuse not Beetlejuice";
$y = substr_count($x, "et");
answer:- 2
Count the number of times "et" occurs in the string

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote