.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Novartis Placement Papers » Novartis Previous Year Placement Paper

 

Novartis Placement Paper -: PHP Questions With Answers


Advertisements
Advertisements




Novartis Previous Years Solved Sample Placement Papers

  1. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions?

    A. 10

    B. 7

    C. 8

    D. 9 Answer: Option C

  2. Solution: The functions are preg_filter(), preg_grep(), preg_match(), preg_match_all(), preg_quote(), preg_replace(), preg_replace_callback(), and preg_split().
  3. Which of the following web servers are required to run the PHP script?

    A. Apache and PHP

    B. IIS

    C. XAMPP

    D. Any of the mentioned Answer: Option B

  4. Solution: PHP requires a web server to run scripts. IIS, XAMPP, and Apache are suitable, but IIS is highlighted here.
  5. What will be the output of the following PHP code snippet?
    <?php
    $url = "[email protected]";
    echo ltrim(strstr($url, "@"),"@");
    ?>

    A. [email protected]

    B. [email protected]

    C. phpmcq@

    D. sanfoundry.com Answer: Option D

  6. Solution: The strstr() function returns the portion of the string starting from the first occurrence of "@", and ltrim() removes the "@".
  7. Which of the following PHP functions can be used to get the current memory usage?

    A. memory_get_usage()

    B. memory_get_peak_usage()

    C. get_peak_usage()

    D. get_usage() Answer: Option A

  8. Solution: The memory_get_usage() function returns the memory currently allocated to the script. The 'real_usage' parameter can specify whether to include unused pages.
  9. Which one of the following PHP functions is used to determine a file’s last access time?

    A. filetime()

    B. fileatime()

    C. fileltime()

    D. filectime() Answer: Option B

  10. Solution: The fileatime() function returns the last access time of a file in Unix timestamp format or FALSE on error.
  11. What will be the output of the following PHP code?
    <?php
    $x = 5;
    $y = 10;
    function fun() {
    $y = $GLOBALS['x'] + $GLOBALS['y'];
    }
    fun();
    echo $y;
    ?>

    A. 5

    B. 10

    C. 15

    D. Error Answer: Option B

  12. Solution: The $GLOBALS array is used to access global variables, but the global $y is not updated in the function, so it remains 10.
  13. PHP recognizes constructors by the name _________

    A. function __construct()

    B. function _construct()

    C. classname()

    D. _construct() Answer: Option A

  14. Solution: PHP uses the double underscore followed by the "construct" keyword to define constructors. The correct syntax is function __construct().




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy