QUESTION 1 You can insert an array variable\'s value into a double quoted string
ID: 3594374 • Letter: Q
Question
QUESTION 1
You can insert an array variable's value into a double quoted string by enclosing the variable in _____.
{ }
( )
< >
[ ]
QUESTION 2
What is printed?
$str1 = "pizza";
echo "Eat more {$str1}s";
Eat more {$str1}s
Eat more pizzas
Eat more pizza
QUESTION 3
"Global variables are automatically available to all parts of your program, including functions."
True
False
QUESTION 4
When this code runs, what is the value of $y?
$user = "Don";
$pw = "12345";
$y = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", $user, $pw);
SELECT * FROM users WHERE user='%s' AND password='%s'
SELECT * FROM users WHERE user=Don AND password=12345
SELECT * FROM users WHERE user='Don' AND password='12345'
None of the other answer are correct
QUESTION 5
What does this code output?
$x = explode(" ", "fe fi fo fum");
echo $x[2];
fi
fo
fe
fum
nothing
QUESTION 6
All functions must return a value.
True
False
QUESTION 7
_____ is the term for the location that a declared variable can be used.
none of these
variable scope
variable type
variable duration
QUESTION 8
Include statements support only absolute path notation.
True
False
QUESTION 9
The include statement and the require statement perform the same function and can be used interchangeably.
True
False
QUESTION 10
"In PHP, you must declare a global variable with the global keyword inside a function definition for the variable to be available within the scope of that function."
True
False
QUESTION 11
A function executes automatically.
True
False
QUESTION 12
"heredoc structures allow printing large chunks of text without having to escape anything, variable values are still inserted."
True
False
QUESTION 13
Function parameters are global variables.
True
False
QUESTION 14
What gets printed?
$x = "Betelgeuse not Beetlejuice";
echo $x[18];
t
e
l
" "
QUESTION 15
The $_POST[] array is an associative array called a superglobal array.
True
False
{ }
( )
< >
[ ]
Explanation / Answer
False : They are not available
(4) SELECT * FROM users WHERE user='Don' AND password='12345'
(5) fo , Explanation: it will print 2nd string starting from 0 , 1 and then 2.
(6) All functions must return a value. : False
(7) variable scope that defines location like stack, heap etc
(8)Include statements support only absolute path notation. : False
(9) The include statement and the require statement perform the same function and can be used interchangeably.: False
(10)
"In PHP, you must declare a global variable with the global keyword inside a function definition for the variable to be available within the scope of that function."
True
(11) A function executes automatically. : False, It will execute only when its called
(12) "heredoc structures allow printing large chunks of text without having to escape anything, variable values are still inserted." : true
(13) Function parameters are global variables: false, they are local to function
(14) prints t , 18th index is 't'
(15)The $_POST[] array is an associative array called a superglobal array. : True
Thanks, let me know if there is any doubts/concern
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.