Wednesday, July 10, 2019

PHP Level 1 Freelancer Exam Questions and Answers

1. Which function is used to start tracking a user?
Answer: session_start();

2. What is the correct way to add 1 to the $counter variable?
Answer: $counter++;

3. Single-line comments in PHP use the following:
Answer: //

4. Which function checks whether a file or directory exists?
Answer: file_exists function

5. Which statement will skip the rest of the current loop iteration and continue execution at the beginning of next iteration?
Answer: continue

6. What statement will delete session files?
Answer: session_destroy();

7. Which statement can replace several else Statements?
Answer: switch

8. PHP variables start with the symbol?
Answer: $

9. What does cURL stand for?
Answer: Client URL

10. Which file mode will Open a file for read and write?
Answer: w+

11. Which function writes a string to a file?
Answer: file_put_contents

12. $count = $count + 8; can be written as:
Answer: $count += 8;

13. Which of the following functions are used to encrypt passwords?
Answer: md5();

14. How do you write "Hello World 2019" in PHP?
Answer: echo "Hello World 2019";

15. Which operator performs the same function as x=x%y?
Answer: %=

16. What do the initials of PHP stand for?
Answer: PHP: Hypertext Preprocessor.

17. Which function returns (and caches) the owner ID number?
Answer: fileowner()

18. What is the actually used PHP version?
Answer: Version 7.1 or 7.2 is the recommended version of PHP.

19. Which function returns (and caches) the owner ID number?
Answer: fileowner();

20. What function raises the first argument to the power of the second argument, with decimal places to be specified by the scale factor?
Answer: bcpow();

21. Which of the following is correct for adding a comment in a PHP script?
Answer: /* comment */

22. What function is used to convert an argument specifying any base in the range 2 to 36?
Answer:  base_convert();

23. Which function takes a single positive integer argument and seeds the random number operator with it?
Answer:  srand();

24. What term refers to the ability to shorten Extra_Long_Names improving readability of source code?
Answer: Aliasing

25. What PHP operator is used to access methods and properties of objects?
Answer:  -> operator

26. What does MTA stand for?
Answer: Mail Transfer Agent

27. Which of the following allows you to express any real number?
Answer: double

28. Which of the correct way to connect to a MySQL database?
Answer: mysql_connect("localhost");

29. Which statement allows you to end a loop?
Answer: break

30. Which file mode will read and write to the creating a new file?
Answer: a+

31. Which function sets the default scale factor for subsequent BC function calls?
Answer:  bcscale();

32. What PHP function returns the arctangent in radians of a numerical argument?
Answer: atan();

33. Which function returns the version of the server?
Answer: Memcache::getVersion

34. Which PHP operator is used to concatenate strings?
Answer: dot (.) operator

35. Which of the following returns the remainder of $a divided by $b?
Answer: $a % $b

No comments:

Post a Comment

Popular Posts