Answer & Solution
'Hello' . ' World' uses the concatenation operator (.) to join the strings 'Hello' and ' World' together. Therefore, the result will be 'Hello World', as the two strings are concatenated to form a single string.
in PHP? | PHP | MYTAT"> in PHP? | PHP | MYTAT">
'Hello' . ' World' in PHP?
'Hello' . ' World' uses the concatenation operator (.) to join the strings 'Hello' and ' World' together. Therefore, the result will be 'Hello World', as the two strings are concatenated to form a single string.
Which of the following PHP functions is used to find the length of an array?
A). count()
B). length()
C). size()
D). sizeof()
Which of the following PHP operators is used for concatenation of strings?
A). .
B). +
C). &&
D). *
Which of the following is a correct way to declare an array in PHP?
A). $colors = array('Red', 'Green', 'Blue');
B). $colors = 'Red, Green, Blue';
C). $colors = {'Red', 'Green', 'Blue'};
D). $colors = [Red, Green, Blue];
What will be the output of the following PHP code?<?php
$x = 10;
echo ++$x;
?>
A). 10
B). 11
C). 9
D). Error
What data type is the variable $age = 25; in PHP?
A). Integer
B). String
C). Boolean
D). Float
What will be the output of the following PHP code?<?php
$name = 'John';
echo 'Hello, $name!';
?>
A). Hello, John!
B). Hello, $name!
C). Hello, !
D). Undefined variable: name
Which of the following statements is true about PHP comments?
A). Comments are ignored by the PHP interpreter
B). Comments can only be single-line
C). Comments must start with /* and end with */
D). Comments are displayed on the webpage
Which of the following PHP operators is used to compare whether two values are equal and of the same data type?
A). ===
B). ==
C). =
D). !=
What is the correct way to declare a variable in PHP?
A). $name = 'John';
B). name = 'John';
C). var name = 'John';
D). String name = 'John';
Which of the following is a correct way to assign a floating-point number to a variable in PHP?
A). $price = 10.99;
B). $price = '10.99';
C). $price = '10.99';
D). $price = 10;