ওডেস্ক পিএইচপি টেস্ট সেপ্টেম্বর ২০১৪

গত পর্বে আমরা ওডেস্ক রেডিনেস ও এইচটিএমএল টেস্ট এর উত্তর গুলো দেখেচিলাম আজ চলুন দেখে নেই পিএইচপি টেস্ট এর আপডেট সেপ্টেম্বর ২০১৪ এর উত্তর গুলো।

oDesk PHP Test Answer 2014

1.Does PHP 5 support exceptions?

  1. Yes
  2. No

2.For the following code: <?php function Expenses() { function Salary() { } function Loan() { function Balance() { } } } ?> Which of the following sequence will run successfully?

  1. Expenses();Salary();Loan();Balance();
  2. Salary();Expenses();Loan();Balance();
  3. Expenses();Salary();Balance();Loan();
  4. Balance();Loan();Salary();Expenses();

3.What function should you use to join array elements with a glue string?

  1. join_st
  2. implode
  3. connect
  4. make_array
  5. None of these

4.What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection.

  1. Use mysql_query() and variables: for example: $input = $_POST['user_input']; mysql_query("INSERT INTO table (column) VALUES ('" . $input . "')");
  2. Use PDO prepared statements and parameterized queries: for example: $input= $_POST["user-input"] $stmt = $pdo->prepare('INSERT INTO table (column) VALUES (":input"); $stmt->execute(array(':input' => $input));
  3. Use mysql_query() and string escaped variables: for example: $input= $_POST["user-input"] $input_safe = mysql_real_escape_string($input); mysql_query("INSERT INTO table (column) VALUES ('" . $input. "')");
  4. Use mysql_query() and variables with a blacklisting check: for example: $blacklist = array("DROP","INSERT","DELETE"); $input= $_POST["user-input"] if (!$array_search($blacklist))) mysql_query("INSERT INTO table (column) VALUES ('" . $input. "')");

5.What is the best way to change the key without changing the value of a PHP array element?

  1. $arr[$newkey] = $oldkey; unset($arr[$oldkey]);
  2. $arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);
  3. $newkey = $arr[$oldkey];unset($arr[$oldkey]);
  4. $arr[$newkey] = $oldkey.GetValue(); unset($arr[$oldkey]);

6.What is the correct line to use within the php.ini file, to specify that 128MB would be the maximum amount of memory that a script may use?

  1. memory_limit = 128M
  2. limit_memory = 128M
  3. memory_limit: 128M
  4. limit_memory: 128M

7.What is the correct way to send a SMTP (Simple Mail Transfer Protocol) email using PHP?

  1. s.sendmail($EmailAddress, [$MessageBody], msg.as_string())
  2. sendmail($EmailAddress, "Subject", $MessageBody);
  3. mail($EmailAddress, "Subject", $MessageBody);
  4. <a href="mailto:$EmailAddress">$MessageBody</a>

8.What is the string concatenation operator in PHP?

  1. +
  2. ||
  3. .
  4. |||
  5. None of these

9.What will be the output of the following code? <? echo 5 * 6 / 2 + 2 * 3; ?>

  1. 1
  2. 20
  3. 21
  4. 23
  5. 34

10.What enctype is required for file uploads to work?

  1. multipart/form-data
  2. multipart
  3. file
  4. application/octect-stream
  5. None of these

এমন আরও সম্পূর্ণ সেট টেস্ট এর উত্তর পাবেন এখানে

যেকোনো প্রয়জনে Facebook এ আমরা।

Level 0

আমি রাফসান জানী। বিশ্বের সর্ববৃহৎ বিজ্ঞান ও প্রযুক্তির সৌশল নেটওয়ার্ক - টেকটিউনস এ আমি 9 বছর 8 মাস যাবৎ যুক্ত আছি। টেকটিউনস আমি এ পর্যন্ত 8 টি টিউন ও 14 টি টিউমেন্ট করেছি। টেকটিউনসে আমার 0 ফলোয়ার আছে এবং আমি টেকটিউনসে 0 টিউনারকে ফলো করি।


টিউনস


আরও টিউনস


টিউনারের আরও টিউনস


টিউমেন্টস

Level 0

Vai matro 10ta kno?

আপনি কত পেয়েছেন এই টেষ্ট দিয়ে? Score??