nerdexam
National_Instruments

200-500 · Question #235

Consider the following PHP script: <?php $fp = fopen('file.txt', 'r'); $string1 = fgets($fp, 512); fseek($fp, 0); ?> Which of the following functions will give the same output as that given by the…

The correct answer is C. rewind(). See the full explanation below for the reasoning.

Question

Consider the following PHP script:

<?php $fp = fopen('file.txt', 'r'); $string1 = fgets($fp, 512); fseek($fp, 0); ?> Which of the following functions will give the same output as that given by the fseek() function in the above script?

Options

  • Afgetss()
  • Bfgets()
  • Crewind()
  • Dfile()

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    75% (18)
  • D
    13% (3)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice