Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

PHP QUESTIONS : PART 31

Give the syntax for opening a file in php

 $variablename= fopen(“path”,”mode”); 

 fopen(“path” ); 

$variablename=file_open(“path”,”mode”);

SHOW ANSWER

What does “path “specify in the syntax fopen(“path”,”mode”); ?

Path of the file to be opened 

Path through which data must flow

Path of the system files

SHOW ANSWER

What does “mode “ specify in the syntax fopen(“path”,”mode”); ?

mode in which the file must be opened 

 specifies wheather a file is hidden or not 

 specifies the file format

SHOW ANSWER

Which mode in fopen is reading only?

r+ 

 x

SHOW ANSWER

Which mode in fopen is read and write?

r+ 

rw 

w

SHOW ANSWER

Which mode in fopen is write only ?

 w+ 

 x+

SHOW ANSWER

The ‘r+’ mode will __________

write to the beginning of the file 

 erase the contents of the file before writing

 write to the end of the file

SHOW ANSWER

The ‘w+’ mode will ________

will read and erase the contents of the file before writing 

 will write to the beginning of the file 

 write to the end of the file

SHOW ANSWER

The ‘ a‘ mode will _________

write only to the end of the file 

 read and write to the end of file 

 write to the beginning of the file

SHOW ANSWER

Which mode in fopen is used to open a file in binary ?

 a 

 r

SHOW ANSWER

The correct example to open a file “ Text.txt “ in read mode only is _____

$opn=fopen(“ Text.txt ”,” r ”); 

 $opn=fopen(“Text.txt”,”r+”); 

$opn=file_open(“Text.txt”,”r”); 

SHOW ANSWER

Choose the correct example to open a file “Read.docx” in write mode only

$wrt=fopen(“Read.docx”,”w”); 

 $wrt=fopen(“Read.docx”,”w+”); 

$wrt=fopen(“Read.docx”,”r”);

SHOW ANSWER

Which mode returns a false value if a file exists ?

x

 w 

r+

SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in