Data Format & Types singleQuestion
1/57
1.

All of the following are the pre-defined XML entities except for which one?

2/57
2.

Which of the following is used to retrieve the namespaces declared in an XML document from a SimpleXMLElement object?

3/57
3.

Which function can be used to format a local timestamp according to a specific locale?

4/57
4.

Which of the following are the methods used for producing web services?

5/57
5.

Which of the following functions will output the current time in the 08:26 am format?

Each correct answer represents a complete solution. Choose all that apply.

6/57
6.

What code snippet will you use at line number four (4) in the code snippet given below?

<?php
$client = new SoapClient("any.wsdl", array('exceptions' => 0));
$result = $client->SomeFunction();
if (??????) {
    trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}
?>
7/57
7.

Which function is used to allow a parser to be used within an object?

8/57
8.

What SimpleXML function is used to parse a file?

9/57
9.

How would you parse a web page at http://example.com/page.php as XML?

10/57
10.

Which function is used to set up start and end element handlers?

11/57
11.

Which of the following was not a built-in terminology before PHP5?

12/57
12.

Keeping into consideration that the EST time zone is one hour ahead of the CST time zone (that is, at any given time it will be one hour later in EST than in CST), what will the following script output?

13/57
13.

Which of the following is an XML protocol that implements the communication between one to another machine, including the publishing, finding, binding, and calling of a Webservice?

14/57
14.

Which of the following protocols is normally used by Webservices?

15/57
15.

Which of the following function is used to parse XML data into an array structure?

16/57
16.

REST is a(n) ...

17/57
17.

Which of the following functions returns an XML string based on SimpleXML element?

18/57
18.

When retrieving and manipulating date values from a database, which of the following techniques will help prevent bugs? (Choose 3)

19/57
19.

What will the following script output?

<?php
$time = strtotime ('2004/01/01');
echo date ('H:\i:s', $time);
?> 
20/57
20.

What is the simplest way of transforming the output of microtime() into a single numeric value?

21/57
21.

Webservices are primarily meant to support

22/57
22.

Which of the following expressions will make a cookie expire in exactly one hour (assuming that the client machine on which the browser is set to the correct time and time zone - and that it resides in a time zone different from your server's)?

23/57
23.

Which of the following definitions describes the time function?

24/57
24.

You have given the following XML data in the tasks.XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
 <tasklist>
       <note>
          <tasks>Validate data</tasks>
          <details>String Validation</details>
       </note>
       <note>
          <tasks>Secure data</tasks>
          <details>Encryption</details>
       </note>
 </tasklist>

Now, you run the following PHP script:

<?php
   $objDOM = new DOMDocument();
   $objDOM->load("tasks.xml"); 
   $note = $objDOM->getElementsByTagName("note");
   foreach( $note as $value )
   {
        $tasks = $value->getElementsByTagName("tasks");
        $task  = $tasks->item(0)->nodeValue;
        $details = $value->getElementsByTagName("details");
        $detail  = $details->item(0)->nodeValue;
        echo "$task :: $detail ";
   }
 ?>

What should be displayed when this script is executed?

25/57
25.

Which of the following sentences are correct?

26/57
26.

What function name should replace the question marks in the following script?

<?php
for ($i = 0; $i < 100; $i++) {
$day = rand (1, 31);
$month = rand (1, 12);
$year = rand (1000, 2500);
 if (????????? ($month, $day, $year)) {
echo "$month/$day/$year is a valid date\n";
 } else {
echo "$month/$day/$year is not a valid date\n";
 }
}
?> 
27/57
27.

Given a class called SoapFunctions and a working WSDL for the methods in that class, what needs to be added to the code below to serve those methods over SOAP?

<?php
require("SoapFunctions.php");
$s = new SoapServer($wsdl);
$s->handle();
?>
28/57
28.

You have been given the following PHP script:

<?php
$xmlstring = <<<XML 
<?xml version="1.0" encoding="ISO-8859-1"?> 
<email> 
<to>jenny@ucertify.com</to> 
<from>john@ucertify.com</from>
<heading>Technical issue in Linux OS</heading>
<body>There is a technical issue in my Linux system. Please Fix it. </body>
</email>
XML;
$xml = new SimpleXMLElement($xmlstring);
foreach($xml->children() as $child)
  {
<Insert code here.>
  }
 ?>

Which of the following code snippets will you insert at line number 14 to get the following output?

to: jenny@ucertify.com
 from: john@ucertify.com
 heading: Technical issue in Linux OS
 body: There is a technical issue in my Linux system. please Fix it.
29/57
29.

What will this script output?

<?php
$emptyArray = [];
$encode = json_encode($emptyArray, JSON_FORCE_OBJECT);
$decode = json_decode($encode);
echo gettype($decode);
30/57
30.

Consider the following XML file:

<?xml version="1.0" encoding="ISO-8859-1" ?>   
 <!DOCTYPE html   
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">   
   <head>   
     <title> SimpleXML Example</title>   
   </head>   
   <body>   
     <h1>   

      Please go <a href="http://www.zendpreparation.com">http://www.zendpreparationcom</a>   

     </h1>   
   </body>   
 </html>

Which of the following statements will display the HREF attribute on the anchor tag if the SimpleXML object is $sxml?

31/57
31.

Fill in the blank with the appropriate function name. The ____ function is used to return the current time measured in the number of seconds since the Unix Epoch (January 1, 1970, 00:00:00 GMT). *Matching is case-insensitive.

32/57
32.

Which of the following is used to retrieve the namespaces used in an XML document from a SimpleXMLElement object?

33/57
33.

Which of the following functions can you use to add data?

Each correct answer represents a complete solution. Choose all that apply.

34/57
34.

Which of the following is used to retrieve the name of an XML element from a SimpleXMLElement object?

35/57
35.

Which of the following can be registered as entry points with a SoapServer instance (choose 3)

36/57
36.

What is the difference, in seconds, between the current timestamp in the GMT time zone and the current timestamp in your local time zone?

37/57
37.

Which of the following will NOT instantiate a DateTime object with the current timestamp?

38/57
38.

Which of the following is a valid SOAP client call?

39/57
39.

Fill in the Blank with the appropriate method name. The ___ is used to import the SimpleXML objects for use with DOM. *Exact matching is required.

40/57
40.

Which of the following functions in SimpleXML can be used to return an iterator containing a list of all subnodes of the current node?

41/57
41.

Your PHP script is repeatedly parsing 500KB of data returned from a remote web service into browser-readable HTML.
Users complain that the script takes a long time to run, Which of the following measures usually leads to the best results?

42/57
42.

What would happen if the following script were run on a Windows server set to Moscow, Russia’s time zone?

<?php
echo gmmktime(0, 0, 0, 1, 1, 1970);
?> 
43/57
43.

Which of the following is used to retrieve the root element from an XML file?

44/57
44.

Given a PHP value, which sample shows how to convert the value to JSON?

45/57
45.

Which of the following functions sets up start and end element handlers?

46/57
46.

All of the following are the advantages of Webservice except for which one?

47/57
47.

Which of the following protocols is used to standardize the description of Web services so providers and requesters are speaking the same language?

48/57
48.

What will be the output of the following PHP script?

<?php
$dom = new DOMDocument();
$dom->load('book.xml');
$a = $dom->documentElement;
print_r($a);
?>
49/57
49.

What DOMElement method should be used to check for availability of a non-namespaced attribute?

50/57
50.

The getdate() function returns _____

51/57
51.

Which of the following is used to create an XML parser with namespace support?

52/57
52.

Which one of the following XML declarations is NOT valid?

53/57
53.

Which of the following retrieves the child nodes of a specified XML node?

54/57
54.

Which of the following functions do not return a timestamp? (Choose 2)

55/57
55.

Which of the following functions will you use to create a new DomElement node?

Each correct answer represents a complete solution. Choose three.

56/57
56.

What will be the output of the following PHP code snippet?

<?php
 echo strtotime("24:00");
 ?>
57/57
57.

Which of the following could be used to add a book to an existing SimpleXMLElement object stored in $library representing a collection of books?