Tag: web technology

Questions Related to web technology

Which of following function return 1 when output is successful?

  1. echo ( )

  2. print()

  3. both

  4. none


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) echo() - This option is incorrect because the echo() function does not return a value. It simply outputs the given string or variable to the browser or console.

Option B) print() - This option is correct because the print() function outputs the given string or variable to the browser or console, and returns a value of 1 if the output is successful.

Option C) both - This option is incorrect because only the print() function returns a value of 1 when the output is successful. The echo() function does not return a value.

Option D) none - This option is incorrect because the print() function does return a value of 1 when the output is successful.

Therefore, the correct answer is B) print(). This option is correct because the print() function returns a value of 1 when the output is successful.

Which of followng statement is more suitable if you want to output a blend of static text and dynamic information stored within one or several variables?

  1. echo()

  2. print()

  3. Printf()

  4. none


Correct Option: C

Which of the following type specifier is invalid in printf() functions?

  1. %a

  2. %b

  3. %c

  4. %d


Correct Option: A

For integer data type PHP 5 and earlier supported?

  1. 8 bit integer value

  2. 16 bit integer value

  3. 32 bit integer value

  4. 64 bit integer value


Correct Option: C
  1. The message

  2. The subject

  3. The header

  4. The recipient


Correct Option: A
  1. Uplaod is not successful, error occurred

  2. The file uploaded with success

  3. Uploaded file size is 0

  4. File upload progress is 0% completed


Correct Option: B

fopen($file_doc,"r+"); opens a file for?

  1. reading

  2. writing

  3. none of above

  4. both of above


Correct Option: D

To work with remote files in PHP you need to enable?

  1. allow_url_fopen

  2. allow_remote_files

  3. both of above

  4. none of above


Correct Option: A

AI Explanation

To work with remote files in PHP, you need to enable the allow_url_fopen directive.

Option A) allow_url_fopen - This option is correct because it allows PHP to open remote files using functions like file_get_contents() and fopen() with URLs as the file path.

Option B) allow_remote_files - This option is incorrect because there is no such directive in PHP.

Option C) Both of the above - This option is incorrect because only the allow_url_fopen directive needs to be enabled to work with remote files in PHP.

Option D) None of the above - This option is incorrect because the allow_url_fopen directive is required to work with remote files in PHP.

The correct answer is A) allow_url_fopen. This option is correct because it allows PHP to open remote files.

Which of the following mode of fopen() function opens a file only for writing. If a file with that name does not exist, attempts to create anew file. If the file exist, place the file pointer at the end of the file after all other data?

  1. A

  2. W

  3. W+

  4. A+


Correct Option: A

The function setcookie( ) is used to:

  1. Declare cookie variables

  2. Store data in cookie variable

  3. Enable or disable cookie support

  4. All of the above


Correct Option: B