Give the syntax for opening a file in php
$variablename= fopen(“path”,”mode”);
fopen(“path” );
$variablename=file_open(“path”,”mode”);
SHOW ANSWERWhat 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 ANSWERWhat 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 ANSWERWhich mode in fopen is reading only?
r
r+
x
SHOW ANSWERWhich mode in fopen is read and write?
r+
rw
w
SHOW ANSWERWhich mode in fopen is write only ?
w
w+
x+
SHOW ANSWERThe ‘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 ANSWERThe ‘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 ANSWERThe ‘ 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 ANSWERWhich mode in fopen is used to open a file in binary ?
b
a
r
SHOW ANSWERThe 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 ANSWERChoose 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 ANSWERWhich mode returns a false value if a file exists ?
x
w
r+
SHOW ANSWER