PHP Interview Questions & Answers part 5

0
327
Q: – What will the following statement output?

echo gettype("4");
The statement will output the string "string".

Q: – What function do you use to find out whether a file is present on your file system?

file_exists()

Q: – How do you determine the size of a file?

filesize() function

Q: – Which function contains the current session's ID?

session_id()

Q: – What does the SID constant return?

If cookies are not available, the SID constant contains a name/value pair that can be incorporated in a query string. It will pass the session ID from script request to script request.

Q: – Which of the following statements does not contain an expression?

4;
gettype(44);
5/12;

They are all expressions because they all resolve to values.

Q: – What function do you use to open a file for reading or writing?

fopen() function

Q: – What functions do you use to add library code to the currently running script?

You can use the require() or include() statement to incorporate PHP files into the current document. You could also use include_once() or require_once().

Q: – What value will the following expression return?

5 < 2

What data type will the returned value be?

The expression will resolve to false, which is a Boolean value.

Submitted By:-Payal Gupta            Email-ID: – payalgupta1325@yahool.com

SHARE

LEAVE A REPLY