menu

PHP File Handling

PHP File Handling - Important Points


11. What is the function used to get the size of a file in PHP?

A. filesize()

B. file_get_size()

C. file_size()

D. get_file_size()

Discuss Work Space

Answer: option a

Explanation:

filesize() is the function used to get the size of a file in PHP.

12. What is the function used to read the entire contents of a file into a string in PHP?

A. file_get_contents()

B. file_put_contents()

C. fread()

D. fgets()

Discuss Work Space

Answer: option a

Explanation:

file_get_contents() is the function used to read the entire contents of a file into a string in PHP.

13. What is the function used to write a string to a file in PHP?

A. file_put_contents()

B. file_get_contents()

C. fwrite()

D. fgets()

Discuss Work Space

Answer: option a

Explanation:

file_put_contents() is the function used to write a string to a file in PHP.

14. What is the function used to get the current position of the file pointer in PHP?

A. ftell()

B. fseek()

C. rewind()

D. fgetpos()

Discuss Work Space

Answer: option a

Explanation:

ftell() is the function used to get the current position of the file pointer in PHP.

15. What is the function used to move the file pointer to a specified position in PHP?

A. fseek()

B. ftell()

C. rewind()

D. fsetpos()

Discuss Work Space

Answer: option a

Explanation:

fseek() is the function used to move the file pointer to a specified position 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