IT Questions and Answers :)

Monday, July 9, 2018

Which is the correct method for defining a function in PHP

Which is the correct method for defining a function in PHP

  • function myFunction($arg_n) { return $retval; }
  • Function myFunction(p1) myFunction = (p1 - 32) End Function
  • int myFunction(int p1) { return p1; }
  • function myFunction(p1, p2) { return p1 * p2; } 

 
Which is the correct method for defining a function in PHP

EXPLANATION


Its very easy to create your own PHP function. Suppose you want to create a PHP function which will simply write a simple message on your browser when you will call it. Following example creates a function called writeMessage() and then calls it just after creating it.
Note that while creating a function its name should start with keyword function and all the PHP code should be put inside { and } braces as shown in the following example below −

<?php
    /* Defining a PHP Function */
    function writeMessage() {
    echo "You are really a nice person, Have a nice time!";
    }
         
    /* Calling a PHP Function */
    writeMessage();
?>

For more information check out: http://php.net/manual/en/functions.user-defined.phpThe other answers and their language is below:
function myFunction(p1, p2) { return p1 * p2; } is JavaScript
Function myFunction(p1) myFunction = (p1 - 32) End Function is VBScript
int myFunction(int p1) { return p1; } is C
Share:

With Windows assigned software packages distributed via Group Policy (to computers), when are packages installed on endpoints?

With Windows assigned software packages distributed via Group Policy (to computers), when are packages installed on endpoints?

  • Randomly 15-60 minutes later
  • During windows updates
  • During their next reboot
  • During the user's next logon 

 
With Windows assigned software packages distributed via Group Policy (to computers), when are packages installed on endpoints?

EXPLANATION

You can assign a program distribution to users or computers. If you assign the program to a user, it is installed when the user logs on to the computer. When the user first runs the program, the installation is completed. If you assign the program to a computer, it is installed when the computer starts, and it is available to all users who log on to the computer. When a user first runs the program, the installation is completed.

SOURCE

https://technet.microsoft.com/en-us/library/cc753768(v=ws.11).aspx
Share:

Which of the following is not a system role in vCenter?

Which of the following is not a system role in vCenter?

  • Administrator
  • Read Only
  • No Access
  • Virtual Machine User (Power User) 
Which of the following is not a system role in vCenter?

EXPLANATION

Virtual Machine User is a sample role on the vCenter system of permissions - No Access, Administrator and Read Only are the system roles which are not customizable.

SOURCE

https://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-60-security-guide.pdf
Share:

What is the maximum number of USB devices a host controller can handle?

What is the maximum number of USB devices a host controller can handle?

  • 128
  • 155
  • 64
  • 127 

 
What is the maximum number of USB devices a host controller can handle?

EXPLANATION

At 7 bits long, a single USB Host Controller can allow up to 127 (2^7 – 1 Host Controller) connected devices.

USB hubs can be cascaded up to seven times, the maximum number of user devices is reduced by number of hubs. So, with 19 hubs attached, the maximum number of available devices is reduced 127 − 19 = 108.

SOURCE

https://en.wikipedia.org/wiki/USB_hub (Physical Layout section)
Share:

What type of DNS record is used by the Sender Policy Framework (SPF)?

What type of DNS record is used by the Sender Policy Framework (SPF)?

  • TXT
  • MX
  • A
  • CNAME 

 
What type of DNS record is used by the Sender Policy Framework (SPF)?

EXPLANATION







Sender Policy Framework (SPF) is a simple email-validation system designed to detect email spoofing. The SPF is an open standard specifying a technical method to prevent sender-address forgery. SPF allows administrators to specify which hosts are allowed to send mail on behalf of a given domain by creating a specific SPF record (or TXT record) in the Domain Name System (DNS). Mail exchangers use DNS records to check that mail from a given domain is being sent by a host sanctioned by that domain's administrators.

Share:

Popular Posts