Backend Development 5 min read

PHP Basic Interview Questions

This article presents a collection of ten PHP basic interview questions covering CSS properties, HTML link targets, CSS centering techniques, color and opacity concepts, JavaScript object references, parsing functions, type coercion, prototype inheritance, DOM selection methods, and AJAX versus form submission nuances.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
PHP Basic Interview Questions

1. Which CSS property can change the height occupied by an inline element?

A. height

B. line-height

C. padding-top, padding-bottom

D. margin-top, margin-bottom

2. The method to open a link in a new window is ________.

A. target = _blank

B. target = _self

C. target = _parent

D. target = _top

3. How to achieve horizontal and vertical centering of a div?

A. position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);

B. position:absolute;top:50%;margin:0 auto;

C. position:absolute;top:50%;left:50%;margin:-50%,-50%;

D. margin:0 auto; transform:translateY(50%);

4. Which statement about rgba() and opacity is inaccurate?

A. rgba() can set color, while opacity only sets transparency

B. opacity affects the element itself and its descendants

C. rgba() only affects the element itself, not its descendants

D. opacity value of 1 means fully transparent.

5. After executing the following code, what is the value of b.value?

var a={value:1};var b = a;b.value = 2;a.value = 3;

A. undefined

B. 1

C. 2

D. 3

6. The result of parseFloat('12.34.5') is

A. NaN

B. 12

C. 12.34

D. 34.5

7. Evaluate the expression: var a = "11" + 2 - "1" + 3; What is the value of a?

A. NaN B. 15

C. 1123

D. 114

8. Consider the following JavaScript code:

function a(){

this.name = "inhe"

}

a.prototype.name = "aaa";

var x = new a();

x.name = "inhemeter";

var y = new a();

What is the value of y.name?

A. undefined

B. inhe

C. inhemeter

D. aaa

9. Which of the following DOM selection statements is incorrect for obtaining the element with id 'a'?

A. document.getElementById('a');

B. document.querySelector('a');

C. document.querySelector('#a');

D. document.querySelectorAll('#a')[0];

10. Which statement about AJAX and form data submission is inaccurate?

A. AJAX can be asynchronous, while forms cannot;

B. Form submission redirects the page, AJAX does not;

C. Forms can upload files, AJAX cannot

D. Both can use GET and POST methods to submit data.

backendweb developmentinterviewphpQuiz
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.