menu

Web Development With PHP

Web Development With PHP - Important Points


26. Which PHP function is used to check if a file exists?

A. file_exists()

B. check_file()

C. exists_file()

D. file_check()

Discuss Work Space

Answer: option a

Explanation:

The file_exists() function is used to check if a file exists in PHP.

27. Which PHP function is used to remove whitespace from the beginning and end of a string?

A. trim()

B. rtrim()

C. ltrim()

D. strip()

Discuss Work Space

Answer: option a

Explanation:

The trim() function is used to remove whitespace from the beginning and end of a string in PHP.

28. Which of the following is NOT a valid way to declare a variable in PHP?

A. $variable = "value";

B. var $variable = "value";

C. $variable = array("value1", "value2");

D. $variable = 123;

Discuss Work Space

Answer: option b

Explanation:

The var keyword is not used to declare variables in PHP. Instead, variables are declared using a $ followed by the variable name.

29. Which PHP function is used to get the current date and time?

A. time()

B. date()

C. datetime()

D. now()

Discuss Work Space

Answer: option b

Explanation:

The date() function is used to get the current date and time in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now