HomeExamsOpen SourceTETAOSSPROIC1120
TETAOSSPROIC1120

Infosys Certified PHP Associate

Practice with real exam-pattern questions for Infosys Certified PHP Associate. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.

BeginnerOpen Source45 min
Free questions

10 Infosys Certified PHP Associate practice questions with answers

Real Lex exam-pattern multiple-choice questions for the Infosys Certified PHP Associate certification. Each question includes the correct answer. The full question bank is available to Premium members.

  1. Question 1

    State True or False:

    “Constant’s value can be changed during execution”.

    • True

      Correct
    • B

      False

  2. Question 2

    How can we enable error reporting in PHP?

    • ini_set(“display_errors”, 1)

      Correct
    • B

      ini_set(“errors”, 1)

    • C

      ini_set(“show_errors”, 1)

    • D

      ini_set(“display”, 1)

  3. Question 3

    Bella has opened a file and read 250 characters. Now she needs to move the cursor back to the 100th character of the file. Which of the following option(s) will do this operation?

    • fseek($file_pointer,-149,SEEK_CUR)

      Correct
    • B

      fseek($file_pointer,-150,SEEK_CUR)

    • C

      fseek($file_pointer,100)

    • D

      fseek($file_pointer,99)

  4. Question 4

    Smith needs to generate 10 unique bill ids for each of his customers starting from B101. Help him to identify the missing lines of the code to complete the bill id generation.

    <?php
    $total_customer=10;
    $i=0;
    $start_value=101;
    while ( ---------- ) 	 # LINE1
    {
    echo "Bill ID:B".$start_value;
    ---------------- ;	 #LINE2
    $i+=1;
    }
    ?>
    

    • LINE 1: $i < $total_customer

      LINE 2: $start_value+=$i;

      Correct
    • B

      LINE 1: $i < $total_customer

      LINE 2: $start_value +=1;

    • C

      LINE 1: $i <= $total_customer

      LINE 2: $start_value +=1;

    • D

      LINE 1: $i <= $total_customer

      LINE 2: $start_value +=$i;

  5. Question 5

    Predict the output of the below code snippet.

    <?php
    $colors = array("red"=>10, "green"=>3, "blue"=>5, "yellow"=>20,"red"=>12,"Blue"=>5,"yellow"=>3); 
    foreach ($colors as $keys=>$values) {
     echo "$keys:$values#"; 	}
    ?>
    

    • red:10#green:3#blue:5#yellow:20#red:12#Blue:5#yellow:3#

      Correct
    • B

      red:12#green:3#blue:5#yellow:3#Blue:5#

    • C

      $keys:$values#$keys:$values#$keys:$values#$keys:$values#$keys:$values#

    • D

      $keys:$values#$keys:$values#$keys:$values#$keys:$values#$keys:$values#$ keys:$values#$keys:$values#

  6. Question 6

    When logout.php page is executed, Peter wants to destroy the cookie "uname". Choose the appropriate code which logout.php should contain:

    • <?php
      setcookie("uname","");
      ?>

      Correct
    • B
      <?php
      setcookie("uname","",time()-60);
      ?>
      

    • C
      <?php
      setcookie("uname",time()-60);
      ?>

    • D
      <?php
      setcookie("",time()-60);
      ?>

  7. Question 7

    Statement 1: system() can be used to execute system level commands from the applications

    Statement 2: execute() can be used to execute system level commands from the applications

    Which of the above statement is/are true?

    • Statement 1

      Correct
    • B

      Statement 2

    • C

      Both statement 1 and statement 2

    • D

      Neither statement 1 nor statement 2

  8. Question 8

    Which of the following code snippet(s) will display the $Name=Ellen.

    • <?php
      $Name="Ellen";
      echo "$Name"=$Name;
      ?>
      

      Correct
    • B
      <?php
      $Name="Ellen";
      echo ' $Name '+=+" $Name ";
      ?>
      

    • C
      <?php
      $Name="Ellen";
      echo ' $Name= "$Name" ';
      ?>
      

    • D
      <?php
      $Name="Ellen";
      echo '$Name'."=".$Name;
      ?>
      

  9. Question 9

    Phil wants to check the size of the uploaded file and notify the user if it exceeds the given size. Which of the following option helps him to retrieve the size of the uploaded file?

    <?php
    < form action="document.php" method="post" enctype="multipart/form-data">
    < input type="file" name="doc" value=”” />
    ?>
    

    • $POST["doc","size"];

      Correct
    • B

      $POST["doc"]["size"];

    • C

      $FILES["doc","size"];

    • D

      $_FILES["doc"]["size"];

  10. Question 10

    What will be the output of the following PHP code?

    <?php
    $a=5;
    print ($a . '>> 2 :' ."$a >> 2");
    ?>
    

    • 5>> 2 :5 >> 2

      Correct
    • B

      5. >> 2 : .5>>2

    • C

      5 >> 2 : 1

    • D

      5 >> 2: $a >> 2

Pricing

Pay once. Clear every cert this year.

One subscription, full Telegram channel access, every PDF posted during your membership.

Monthly
50% OFF
₹1,300₹2,600
Per month · cancel anytime
  • Full access to all 1,357+ certifications
  • Monthly updated question banks
  • Telegram private channel access
  • Cancel anytime
Get Monthly
POPULAR
Quarterly
44% OFF
₹1,800₹3,200
That's ₹600/mo · billed for 3 months
  • Everything in Monthly
  • Save ₹2,100 vs monthly billing
  • Priority answer key requests
  • Best for increasing DQ score fast
Get Quarterly
BEST VALUE
Lifetime
52% OFF
₹2,400₹5,000
One-time · lifetime access
  • Everything in Quarterly
  • Lifetime channel access — no renewals
  • All future certifications included
  • Priority response from admin team
Get Lifetime
FAQ

Common questions, straight answers.

A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.

Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.

We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.

Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.

Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.

i
InfyLexDumps

Independent exam preparation platform for Infosys Lex certifications. Real exam-pattern question banks, monthly updates, 180K+ community members.

Join Premium Telegram
Contact
  • @prepflixadmin
  • admin@prepflix.net
This platform is an independent educational resource and is not affiliated with or endorsed by Infosys Ltd. All certification names referenced are property of their respective owners.
© 2026 InfyLexDumps
Join Premium Telegram