Upwork Test answers 2018 | Latest | Solved | Top 10 %

Q.1:

Given the following array:

$array = array(0 => 'blue', 1 => 'red', 2 => 'Green', 3 => 'red');

which one of the following will print 2?

Given%2Bthe%2Bfollowing%2Barray%252C%2Bwhich%2Bwill%2Bprint%2B2
Q.2:

if you are given two dates in this form;

Start Date: 2017-03-24
End Date: 2009-06-26

which code snippet finds the difference between these 2 in the following form;

2 years, 3 months, and 2 days

PHP > 5.3

correct%2Bformat%2Bto%2Bconvert%2Brepresent%2Byear

Q.3:
PDO_MYSQL data source name (DSN) is composed of following elements?
1
Q.4:

Which function can be used to determine if a file exists?

2
Q.5:
you can extend the exception class but you cannot extend any on the preceding methods because they are declared as:
3
Q.6: 
PHP currently offering following functions for searching strings using POSIX-Style regular expressions?
4
Q.7:
 How to create a database with PHP in MySQL server?
5
Q.8:
 with regard to the static keyword in PHP, which of the following statement is false?
6
Q.9:
 which of the following is not a valid DOM method in PHP?
7
Q.10: 
which of the following statement is incorrect with respect to “!==” and “==!”?
8
Q.11:
 what is the procedural style of the associative array?
9
Q.12: 
what is the difference between “echo” and “print” in PHP?
10
Q.13:

what will be the output of the following code?

<?php
var_dump(floor(3.74));
?>

11
Q.14:
Which of the following will be used to print today’s date in PHP?

Inked12 LI
Q.15:
what is the output of the following code?
$foo = 400;
$bar = 10;
echo $foo.”+”.$bar;
13
Q.16:
Correct format to convert represent year 2
correct%2Bformat%2Bto%2Bconvert%2Brepresent%2Byear%2B2
Q.17:
How to enable short tag in php.ini file?
enable%2Bshort%2Btag%2Bin%2Bphp
Q.18:
What will be the output of the following code?
hellowrd
Q.19:
How to remove white spaces from the beginning and end of the string variable in PHP?
how%2Bto%2Bremove%2Bwhite%2Bspaces%2Bfrom%2Bbegning%2Band%2Bend%2Bof%2Bthe%2Bstring

Q.20:

how would you create enums in php?

how%2Bwould%2Byou%2Bcreate%2Benums%2Bin%2Bphp

Q.21:

which of the following are valid My_Sqli configuration options?

Inkedwhich%2Bof%2Bthe%2Bfollowig%2Bare%2Bvalid%2Bmysqli%2Bconfiguration%2Boptions LI%2B%25282%2529
Q.22:
Which of these is not a valid API?
not%2Ba%2Bvalid%2BAPI
Q.23:
PHP currently offers the following functions for searching strings using POSIX style regular expressions?
Q.24:
placing the _____ symbol before a function tells php to suppress any errors generated by that function
placing%2Bthe%2B %2Bsymbol%2Bbefore%2Ba%2Bfunction%2Btells%2Bphp%2Bto%2Bsuppress%2Bany%2Berrors%2Bgenerated%2Bby%2Bthat%2Bfunction

Q.25:

How can you rename a file in PHP?

rename%2Ba%2Bdb

Q.26:

simple way to send smtp email:

simple%2Bway%2Bto%2Bsend%2Bsmtp%2Bemail

Q.27:

What are methods in PHP?

what%2Bare%2Bmethods%2Bin%2BPHP.

Q.28:

what happens if the fatal error was thrown in your program?

what%2Bhaopen%2Bif%2Bthe%2Bfatal%2Berror%2Bwas%2Bthrown%2Bin%2Byour%2Bprogram

Q.29:

what is the best practice for running MySQL queries in PHP consider the risk of SQL injection?

what%2Bis%2Bthe%2Bbest%2Bpractice%2Bfor%2Brunning%2Bmysql%2Bqueries%2Bin%2Bphp%2Bconsider%2Bthe%2Brisk%2Bof%2Bsql%2Binjection

Q.30:

what is the correct syntax of constructor function?

Q.31:

what is wrong with the following code ?

what%2Bis%2Bwrong%2Bwtih%2Bthe%2Bfollowing%2Bcode%2B2

Q.32:

what of the following mode is used to write into the file at the end of the existing content and create the file if it does not exist?

Q.33:

what will be the output of the following code?

what%2Bwill%2Bbe%2Bthe%2Boutput%2Bof%2Bthe%2Bfollowig%2Bcode

Q.34:

which function is used to determine that a file exists?

Q.35:

which function is used to read a file removing the HTML and PHP tags in it?

which%2Bfunction%2Bis%2Bused%2Bto%2Bread%2Ba%2Bfile%2Bremoving%2Bthe%2BHTML%2Band%2BPHP%2Btags%2Bin%2Bit

Q.36:

which function will used to destroy a variable or object?

which%2Bfunction%2Bwill%2Bused%2Bto%2Bdestroy%2Ba%2Bvariable%2Bor%2Bobject

Q.37:

which inbuilt function will add value to end of the array?

which%2Binbuild%2Bfunction%2Bwill%2Badd%2Bvalue%2Bto%2Bend%2Bof%2Bthe%2Barray

Q.38:

which is the correct syntax of mail() function in PHP?

Q.39:

which is the valid way to add 1 to count variable?

which%2Bis%2Bthe%2Bvalid%2Bway%2Bto%2Badd%2B1%2Bto%2Bcount%2Bvariable

Q.40:

which method is use d to tweak an object cloning behavior in php?

which%2Bmethod%2Bis%2Buse%2Bd%2Bto%2Btweak%2Ban%2Bobject%2Bcloning%2Bbehaviour%2Bin%2Bphp

Q.41:

which mime type needs to be used to send an attachment in mail?

which%2Bmime%2Btype%2Bneeds%2Bto%2Bbe%2Bused%2Bto%2Bsend%2Ban%2Battachment%2Bin%2Bmail

Q.42:

which of the following are valid MySQL configuration options- true?

which%2Bof%2Bthe%2Bfollowig%2Bare%2Bvalid%2Bmysqli%2Bconfiguration%2Boptions %2Btrue

Q.43:

which of the following will produce val of 83?

which%2Bof%2Bthe%2Bfollowig%2Bwill%2Bproduce%2Bval%2Bof%2B83

Q.44:

which of the following is true about singleton design pattern?

which%2Bof%2Bthe%2Bfollowing%2Bis%2Btrue%2Babout%2Bsingleton%2Bdesign%2Bpattern.

Q.45:

which of the following will detect which request type was used (GET, POST, PUT or DELETE) q.mark?

which%2Bof%2Bthe%2Bfollowing%2Bwill%2Bdetect%2Bwhich%2Brequest%2Btype%2Bwas%2Bused%2B%2528GET%252C%2BPOST%252C%2BPUT%2Bor%2BDELETE%2529%2Bq.mark

Q.46:

which of these is not a valid SimpleXml parser method?

which%2Bof%2Bthese%2Bis%2Bnot%2Ba%2Bvalid%2BSimpleXml%2Bparser%2Bmethod

Q.47:

which one is valid XML API?

which%2Bone%2Bis%2Bvalid%2BXML%2BAPI

Q.48:

which statement is not correct ?

which%2Bstatement%2Bis%2Bnot%2Bcorrect%2B2

Q.49:

you can extend the exception class but you can not override any of the preceding methods because they are declared as?

Q.50:

what of the following mode is used to write into the file at the end of the existing content and create the file if it does not exist?

This site uses Akismet to reduce spam. Learn how your comment data is processed.

small_c_popup.png

Congratulations!

You have successfully subscribed to my email list. Now you will be recieving latest wordpress tips and tricks directly in your mail box.

Don’t worry! I won’t spam you

AllEscort