📚 Exam by Category
▾
Objective Questions

Latest UGVCL Assistant Manager Exam Question (Objective Questions), MCQ in English

Subjects : Computer

Question Bank UGVCL Assistant Manager (IT) Exam Tier 2 - English
Back to Exam

Computer

Question 1Single Answer
What is the default port used by PHP's built-in development server when running php -S localhost:8000?
  1. A
    80
  2. B
    8080
  3. C
    443
  4. D
    8000
Question 2Single Answer
Which directive in php.ini sets the maximum execution time of a PHP script?
  1. A
    script_timeout
  2. B
    max_script_time
  3. C
    max_execution_time
  4. D
    execution_limit
Question 3Single Answer
What command is used to check the installed PHP version on a Linux system?
  1. A
    php -v
  2. B
    php --version
  3. C
    php version
  4. D
    Both a and b
Question 4Single Answer
Which PHP module is required to enable MySQL database connectivity?
  1. A
    Both b and c
  2. B
    mysqli
  3. C
    pdo_mysql
  4. D
    php_mysql
Question 5Single Answer
What is the default file extension for PHP configuration files?
  1. A
    .conf
  2. B
    .php
  3. C
    .ini
  4. D
    .cfg
Question 6Single Answer
What function is used to trigger a user-defined error in PHP?
  1. A
    error_log
  2. B
    throw_error
  3. C
    trigger_error
  4. D
    raise_error
Question 7Single Answer
Which keyword is used to handle exceptions in PHP?
  1. A
    All of the above
  2. B
    try
  3. C
    throw
  4. D
    catch
Question 8Single Answer
What will try { echo 1/0; } catch (Exception $e) { echo "Error"; } output in PHP?
  1. A
    Division by zero
  2. B
    Error
  3. C
    1
  4. D
    No output
Question 9Single Answer
Which PHP function displays all errors and warnings?
  1. A
    log_errors
  2. B
    display_errors
  3. C
    show_errors
  4. D
    error_reporting(E_ALL)
Question 10Single Answer
What is the default error reporting level in PHP if not explicitly set?
  1. A
    E_WARNING
  2. B
    E_NOTICE
  3. C
    E_ALL
  4. D
    E_ERROR
Question 11Single Answer
Which PHP function is used to cache the output of a script to improve performance?
  1. A
    output_cache
  2. B
    cache_output
  3. C
    buffer_start
  4. D
    ob_start
Question 12Single Answer
What is the benefit of using isset instead of direct variable access in PHP?
  1. A
    Faster execution
  2. B
    Both a and b
  3. C
    Reduces memory usage
  4. D
    Prevents undefined variable notices
Question 13Single Answer
Which loop is generally faster for iterating over arrays in PHP?
  1. A
    foreach
  2. B
    for
  3. C
    while
  4. D
    do-while
Question 14Single Answer
What does the use keyword allow in PHP anonymous functions?
  1. A
    Importing namespaces
  2. B
    Including files
  3. C
    Defining constants
  4. D
    Accessing variables from the parent scope
Question 15Single Answer
Which PHP function can reduce memory usage when handling large strings?
  1. A
    strlen
  2. B
    unset
  3. C
    str_split
  4. D
    substr
Question 16Single Answer
Which PHP function connects to a MySQL database using the mysqli extension?
  1. A
    mysql_connect
  2. B
    mysqli_connect
  3. C
    pdo_connect
  4. D
    db_connect
Question 17Single Answer
What is the correct PDO connection string for MySQL?
  1. A
    pdo:mysql:host=localhost;dbname=test
  2. B
    mysql:host=localhost;dbname=test
  3. C
    mysql:connect=localhost;database=test
  4. D
    db:mysql:host=localhost;dbname=test
Question 18Single Answer
Which PHP extension is used to connect to an Oracle database?
  1. A
    Both a and c
  2. B
    oracle_pdo
  3. C
    pdo_oracle
  4. D
    oci8
Question 19Single Answer
What is the correct function to connect to a PostgreSQL database in PHP?
  1. A
    sql_connect
  2. B
    postgres_connect
  3. C
    pdo_postgres
  4. D
    pg_connect
Question 20Single Answer
Which PHP function executes a prepared statement in MySQLi?
  1. A
    mysqli_stmt_execute
  2. B
    mysqli_execute
  3. C
    mysqli_query
  4. D
    mysqli_run
Question 21Single Answer
What does strlen("Hello") return in PHP?
  1. A
    6
  2. B
    5
  3. C
    4
  4. D
    Error
Question 22Single Answer
What is the output of str_replace("World", "PHP", "Hello World") in PHP?
  1. A
    Hello World
  2. B
    World PHP
  3. C
    Hello PHP
  4. D
    Error
Question 23Single Answer
What does strtoupper("hello") return in PHP?
  1. A
    Hello
  2. B
    hello
  3. C
    HELLO
  4. D
    Error
Question 24Single Answer
What is the output of substr("Hello World", 6, 5) in PHP?
  1. A
    World
  2. B
    Hello
  3. C
    Error
  4. D
    o Wor
Question 25Single Answer
What does trim(" Hello ") return in PHP?
  1. A
    Hello
  2. B
    " Hello "
  3. C
    "Hello"
  4. D
    Error
Question 26Single Answer
What function is used to start a session in PHP?
  1. A
    start_session
  2. B
    session_start
  3. C
    session_begin
  4. D
    init_session
Question 27Single Answer
What is the default session timeout in PHP?
  1. A
    15 minutes
  2. B
    10 minutes
  3. C
    20 minutes
  4. D
    24 minutes
Question 28Single Answer
How do you destroy a session in PHP?
  1. A
    session_destroy
  2. B
    session_unset
  3. C
    session_end
  4. D
    session_clear
Question 29Single Answer
What does $_SESSION['user'] = "John"; do in PHP?
  1. A
    Creates a cookie
  2. B
    Updates a database
  3. C
    Deletes a session
  4. D
    Stores a session variable
Question 30Single Answer
What function removes all session variables in PHP?
  1. A
    session_remove
  2. B
    session_destroy
  3. C
    session_clear
  4. D
    session_unset
Question 31Single Answer
What was the purpose of magic quotes in older PHP versions?
  1. A
    Managing database connections
  2. B
    Encrypting session data
  3. C
    Optimizing code execution
  4. D
    Automatic escaping of input data
Question 32Single Answer
Which PHP directive enabled magic quotes for GET/POST/COOKIE data?
  1. A
    magic_quotes_input
  2. B
    magic_quotes_gpc
  3. C
    auto_quotes
  4. D
    input_quotes
Question 33Single Answer
What function was used to check if magic quotes were enabled?
  1. A
    get_magic_quotes
  2. B
    magic_quotes_enabled
  3. C
    get_magic_quotes_gpc
  4. D
    check_quotes
Question 34Single Answer
What does stripslashes do in PHP?
  1. A
    Adds slashes to strings
  2. B
    Escapes special characters
  3. C
    Removes slashes from strings
  4. D
    Trims whitespace
Question 35Single Answer
In which PHP version were magic quotes completely removed?
  1. A
    5.3
  2. B
    7.4
  3. C
    7.0
  4. D
    5.4
Question 36Single Answer
What does date("Y-m-d") output in PHP?
  1. A
    Error
  2. B
    Current time
  3. C
    Current year
  4. D
    Current date in YYYY-MM-DD format
Question 37Single Answer
What function returns the current Unix timestamp in PHP?
  1. A
    timestamp
  2. B
    date
  3. C
    time
  4. D
    now
Question 38Single Answer
What is the output of strtotime("next Monday") in PHP?
  1. A
    Unix timestamp
  2. B
    Date string
  3. C
    Error
  4. D
    Current date
Question 39Single Answer
What does date("H:i:s") return in PHP?
  1. A
    Current date
  2. B
    Current year
  3. C
    Current time in HH:MM:SS format
  4. D
    Error
Question 40Single Answer
What function formats a timestamp into a readable date in PHP?
  1. A
    date_format
  2. B
    format_date
  3. C
    date
  4. D
    time_format
Question 41Single Answer
Which PHP extension is required for image processing?
  1. A
    GD
  2. B
    ImageMagick
  3. C
    None
  4. D
    Both a and b
Question 42Single Answer
What function creates a new image from a PNG file in PHP?
  1. A
    loadpng
  2. B
    imagepng
  3. C
    createimage
  4. D
    imagecreatefrompng
Question 43Single Answer
What does imagejpeg($image, "output.jpg") do in PHP?
  1. A
    Creates a JPEG image
  2. B
    Loads a JPEG image
  3. C
    Saves an image as JPEG
  4. D
    Displays a JPEG image
Question 44Single Answer
What function resizes an image in PHP using the GD library?
  1. A
    resizeimage
  2. B
    imageresize
  3. C
    image_scale
  4. D
    imagecopyresized
Question 45Single Answer
What does imagedestroy($image) do in PHP?
  1. A
    Deletes an image file
  2. B
    Saves an image
  3. C
    Frees memory used by an image
  4. D
    Creates an image
Question 46Single Answer
What does explode(" ", "Hello World") return in PHP?
  1. A
    Error
  2. B
    String "Hello World"
  3. C
    Array ["Hello", "World"]
  4. D
    Array ["Hello World"]
Question 47Single Answer
What is the output of implode( ["a", "b", "c"]) in PHP?
  1. A
    ["a", "b", "c"]
  2. B
    a,b,c
  3. C
    Error
  4. D
    a b c
Question 48Single Answer
What does preg_match("/[0-9]+/", "123abc") return in PHP?
  1. A
    0
  2. B
    123
  3. C
    1
  4. D
    Error
Question 49Single Answer
What function removes HTML tags from a string in PHP?
  1. A
    remove_tags
  2. B
    strip_tags
  3. C
    clean_html
  4. D
    html_strip
Question 50Single Answer
What does htmlspecialchars("Hello") return in PHP?
  1. A
    Hello
  2. B
    Hello
  3. C
    Hello
  4. D
    Error
Important Questions Package

UGVCL Assistant Manager Exam Online Question Bank Package

Buy UGVCL Assistant Manager Important Questions, MCQ, question answer in Hindi & English. It will help you to score high marks in UGVCL Assistant Manager question bank 2026 in Online, PDF & Print study material.

+ Free Monthly Current Affairs, GK & more PDF Download
Sr.Package NameAmount
1.UGVCL Assistant Manager (IT) Exam Tier 1 - English
Description : 1000 Question with Answer
₹101 [₹500]
2.UGVCL Assistant Manager (IT) Exam Tier 1 - English
Description : 2000 Question with Answer
₹151 [₹500]
3.UGVCL Assistant Manager (IT) Exam Tier 2 - English
Description : 1000 Question with Answer
₹101 [₹500]
4.UGVCL Assistant Manager (IT) Exam Tier 2 - English
Description : 1500 Question with Answer
₹131 [₹500]
5.UGVCL Assistant Manager (IT) Exam Tier 1 - English
Description : 1000 Question & Answer Download in PDF (Send by Email)
₹151 [₹450]
6.UGVCL Assistant Manager (IT) Exam Tier 2 - English
Description : 1000 Question & Answer Download in PDF (Send by Email)
₹151 [₹450]
7.UGVCL Assistant Manager (IT) Exam Tier 1 Question Bank Book - English
Description : 1000 Question with Answer (Printed Material)
₹390 [₹600]
8.UGVCL Assistant Manager (IT) Exam Tier 2 Question Bank Book - English
Description : 1000 Question with Answer (Printed Material)
₹390 [₹600]
Back to Exam