Learn with Yasir

Share Your Feedback

PHP Basics Fill in the Blanks – Practice Core Concepts with Interactive Questions


Test your understanding of PHP basics with fill in the blanks questions. Perfect for beginners, students, and interview preparation. Strengthen your PHP knowledge now!

🔍 Fill in the Blanks

🟢 Beginner

  1. In PHP, a ________ is a file that contains one or more scripts.
  2. Answer

    script

    A script is a PHP file that contains code to be executed on the server, often generating dynamic content for web pages.


  3. The ________ statement in PHP is used to output data to the browser.
  4. Answer

    echo

    The echo statement is used to output one or more strings to the browser, displaying content on the web page.


  5. In PHP, a ________ is used to store data like text, numbers, or arrays.
  6. Answer

    variable

    A variable in PHP is used to store data, and its value can change during the execution of the script.


  7. The ________ function in PHP outputs information about PHP's configuration.
  8. Answer

    phpinfo

    The phpinfo() function outputs a large amount of information about the current state of PHP, including loaded extensions and configuration settings.


🟡 Intermediate

  1. To start a new line within the same PHP statement, you can use ________.
  2. Answer

    newline character

    In PHP, you can use the newline character ( ) to start a new line within the same statement, improving readability.


🔴 Advanced



📚 Related Resources

✍️ Fill in the Blanks

  1. ________ is a popular client-side scripting language mainly used to add interactivity to websites. ✅ JavaScript

  2. Server-side scripts are executed on the ________, not in the user’s browser. ✅ server

  3. ________ is used to connect web applications to databases on the server side. ✅ PHP

  4. The scripting language that starts with “J” and works in both client-side and server-side environments is ________. ✅ JavaScript

  5. Client-side scripting improves ________ experience by enabling dynamic interaction without contacting the server. ✅ user